diff options
| author | HariKrishna Sagala <hariconscious@gmail.com> | 2025-12-17 11:14:59 +0530 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2025-12-18 08:21:52 +0000 |
| commit | 3622dc47a4b13e0ec86358c7b54a0b33bfcaa03c (patch) | |
| tree | 686b33e7a2ae1a27c91c32a85b93d48b12ec554a | |
| parent | 961f20faa4b950c449dc98fa95a056ef368a24fc (diff) | |
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>
| -rw-r--r-- | sound/soc/codecs/rt286.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index 2fbb5860c421..195658f626cc 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c @@ -1236,7 +1236,7 @@ static int rt286_i2c_probe(struct i2c_client *i2c) } if (rt286->i2c->irq) { - ret = request_threaded_irq(rt286->i2c->irq, NULL, rt286_irq, + ret = devm_request_threaded_irq(&rt286->i2c->dev, rt286->i2c->irq, NULL, rt286_irq, IRQF_TRIGGER_HIGH | IRQF_ONESHOT, "rt286", rt286); if (ret != 0) { dev_err(&i2c->dev, @@ -1252,22 +1252,12 @@ static int rt286_i2c_probe(struct i2c_client *i2c) return ret; } -static void rt286_i2c_remove(struct i2c_client *i2c) -{ - struct rt286_priv *rt286 = i2c_get_clientdata(i2c); - - if (i2c->irq) - free_irq(i2c->irq, rt286); -} - - static struct i2c_driver rt286_i2c_driver = { .driver = { .name = "rt286", .acpi_match_table = ACPI_PTR(rt286_acpi_match), }, .probe = rt286_i2c_probe, - .remove = rt286_i2c_remove, .id_table = rt286_i2c_id, }; |
