Skip to content

Commit f31e0d0

Browse files
Uwe Kleine-Königbroonie
authored andcommitted
ASoC: tlv320adc3xxx: Don't strip remove function when driver is builtin
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: e9a3b57 ("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>
1 parent 6c023ad commit f31e0d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/soc/codecs/tlv320adc3xxx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,7 @@ static int adc3xxx_i2c_probe(struct i2c_client *i2c)
14291429
return ret;
14301430
}
14311431

1432-
static void __exit adc3xxx_i2c_remove(struct i2c_client *client)
1432+
static void adc3xxx_i2c_remove(struct i2c_client *client)
14331433
{
14341434
struct adc3xxx *adc3xxx = i2c_get_clientdata(client);
14351435

@@ -1452,7 +1452,7 @@ static struct i2c_driver adc3xxx_i2c_driver = {
14521452
.of_match_table = tlv320adc3xxx_of_match,
14531453
},
14541454
.probe = adc3xxx_i2c_probe,
1455-
.remove = __exit_p(adc3xxx_i2c_remove),
1455+
.remove = adc3xxx_i2c_remove,
14561456
.id_table = adc3xxx_i2c_id,
14571457
};
14581458

0 commit comments

Comments
 (0)