]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: cs35l56: Don't use devres to unregister component
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Tue, 5 May 2026 16:11:23 +0000 (17:11 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 6 May 2026 12:22:50 +0000 (21:22 +0900)
commitbee87cf0f1248c0f20710d7a79df41fe892d9f88
tree5c36ea063834c15889b7da6ac5bac59bc5d2ba94
parent7fd2df204f342fc17d1a0bfcd474b24232fb0f32
ASoC: cs35l56: Don't use devres to unregister component

Manually call snd_soc_unregister_component() from cs35l56_remove()
instead of using devres cleanup. This ensures that the component is
destroyed before cs35l56_remove() starts cleanup of anything the
component code could be using.

Devres cleanup happens after the driver remove() callback, so if
snd_soc_register_component() is used, it will not be destroyed until
after cs35l56_remove() has returned. But there is some cleanup that
must be done in cs35l56_remove(), or wrapped in a custom devres
cleanup handler to ensure correct ordering. The simplest option is
to call snd_soc_unregister_component() at the start of cs35l56_remove().

Fixes: e49611252900 ("ASoC: cs35l56: Add driver for Cirrus Logic CS35L56")
Closes: https://sashiko.dev/#/patchset/20260501103002.2843735-1-rf%40opensource.cirrus.com
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260505161124.3621000-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs35l56.c