ASoC: codec: rt298: Use devm_request_threaded_irq to manage IRQ lifetime and fix smatch warning
Subsystems (3)
PATCH 1/1 ASoC: codec: rt298: Use devm_request_threaded_irq to manage IRQ lifetime and fix smatch warning
From: HariKrishna Sagala <[email protected]>
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.
---
This patch replaces the manual management of IRQ with the device managed IRQ API. Also, it removes the smatch reported warning.
sound/soc/codecs/rt298.c:1298 rt298_i2c_probe() warn: 'rt298->i2c->irq' from request_threaded_irq() not released on lines: 1298.
Removed the "remove" function as IRQ is managed automatically.
Thank you.
sound/soc/codecs/rt298.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
sound/soc/codecs/rt298.c +1 -11
@@ -1282,7 +1282,7 @@ static int rt298_i2c_probe(struct i2c_client *i2c) rt298->is_hp_in =-1 ;if (rt298->i2c->irq) { - ret =request_threaded_irq (rt298->i2c->irq,NULL , rt298_irq, + ret =devm_request_threaded_irq (&rt298->i2c->dev, rt298->i2c->irq,NULL , rt298_irq,IRQF_TRIGGER_HIGH |IRQF_ONESHOT ,"rt298" , rt298);if (ret !=0 ) { dev_err(&i2c->dev,
@@ -1298,22 +1298,12 @@ static int rt298_i2c_probe(struct i2c_client *i2c)return ret; } -static void rt298_i2c_remove (struct i2c_client *i2c) -{ -struct rt298_priv *rt298 =i2c_get_clientdata (i2c); - -if (i2c->irq) -free_irq (i2c->irq, rt298); -} - -static struct i2c_driver rt298_i2c_driver = { .driver = { .name ="rt298" , .acpi_match_table =ACPI_PTR (rt298_acpi_match), }, .probe = rt298_i2c_probe, - .remove = rt298_i2c_remove, .id_table = rt298_i2c_id, };
base-commit: ea1013c1539270e372fc99854bc6e4d94eaeff66
Signature · 1 line
2.43.0
Mark Brown
maintainerQuoted 8 lines · On Wed, 17 Dec 2025 16:13:58 +0530, [email protected] wrote:
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 asfree_irqis tied to device teardown.[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: codec: rt298: Use devm_request_threaded_irq to manage IRQ lifetime and fix smatch warning
commit: 3a4e4e0003678a87600e82d02c9522af282a5c0b
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark