Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: codec: rt286: Use devm_request_threaded_irq to manage IRQ lifetime and fix smatch warning

Replace manual "request_threaded_irq()" with the device managed
"devm_request_threaded_irq" to manage the IRQ lifetime and also
it removes the smatch reported warning.
Remove the manual "free_irq()" in the "remove" function as free_irq
is tied to device teardown.

Signed-off-by: HariKrishna Sagala <hariconscious@gmail.com>
Link: https://patch.msgid.link/20251217054458.38257-2-hariconscious@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

HariKrishna Sagala and committed by
Mark Brown
3622dc47 961f20fa

+1 -11
+1 -11
sound/soc/codecs/rt286.c
··· 1236 1236 } 1237 1237 1238 1238 if (rt286->i2c->irq) { 1239 - ret = request_threaded_irq(rt286->i2c->irq, NULL, rt286_irq, 1239 + ret = devm_request_threaded_irq(&rt286->i2c->dev, rt286->i2c->irq, NULL, rt286_irq, 1240 1240 IRQF_TRIGGER_HIGH | IRQF_ONESHOT, "rt286", rt286); 1241 1241 if (ret != 0) { 1242 1242 dev_err(&i2c->dev, ··· 1252 1252 return ret; 1253 1253 } 1254 1254 1255 - static void rt286_i2c_remove(struct i2c_client *i2c) 1256 - { 1257 - struct rt286_priv *rt286 = i2c_get_clientdata(i2c); 1258 - 1259 - if (i2c->irq) 1260 - free_irq(i2c->irq, rt286); 1261 - } 1262 - 1263 - 1264 1255 static struct i2c_driver rt286_i2c_driver = { 1265 1256 .driver = { 1266 1257 .name = "rt286", 1267 1258 .acpi_match_table = ACPI_PTR(rt286_acpi_match), 1268 1259 }, 1269 1260 .probe = rt286_i2c_probe, 1270 - .remove = rt286_i2c_remove, 1271 1261 .id_table = rt286_i2c_id, 1272 1262 }; 1273 1263