]> git.itanic.dy.fi Git - linux-stable/commit
ASoC: tlv320adc3xxx: Don't strip remove function when driver is builtin
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Sun, 10 Mar 2024 14:38:51 +0000 (15:38 +0100)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:17:30 +0000 (18:17 -0400)
commit3c48b05e46df2b72ebdec83b0ec13903334a46e5
treef3e95438a2c1b6a34fcb6bf1cd7a637a5db4bad8
parent53c3716d17da4ac0f7c4bf9447e593f4e49aa965
ASoC: tlv320adc3xxx: Don't strip remove function when driver is builtin

[ Upstream commit f31e0d0c2cad23e0cc48731634f85bb2d8707790 ]

Using __exit for the remove function results in the remove callback
being discarded with SND_SOC_TLV320ADC3XXX=y. When such a device gets
unbound (e.g. using sysfs or hotplug), the driver is just removed
without the cleanup being performed. This results in resource leaks. Fix
it by compiling in the remove callback unconditionally.

This also fixes a W=1 modpost warning:

WARNING: modpost: sound/soc/codecs/snd-soc-tlv320adc3xxx: section mismatch in reference: adc3xxx_i2c_driver+0x10 (section: .data) -> adc3xxx_i2c_remove (section: .exit.text)

(which only happens with SND_SOC_TLV320ADC3XXX=m).

Fixes: e9a3b57efd28 ("ASoC: codec: tlv320adc3xxx: New codec driver")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://msgid.link/r/20240310143852.397212-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/codecs/tlv320adc3xxx.c