On Sun, Mar 10, 2024 at 3:39 PM Uwe Kleine-König u.kleine-koenig@pengutronix.de wrote:
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
Hello,
note that this patch only applies as is after commit 4e8ff3587868 ("ASoC: codecs: tlv320adc3xxx: Wrap adc3xxx_i2c_remove() in __exit_p()") which was the wrong approach to fix the build error.
Sorry, my bad... Reviewed-by: Geert Uytterhoeven geert@linux-m68k.org
Gr{oetje,eeting}s,
Geert