summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHariKrishna Sagala <hariconscious@gmail.com>2025-11-21 19:39:43 +0530
committerMark Brown <broonie@kernel.org>2025-12-14 19:37:29 +0900
commitd00e80606e76233f4ae03486a9809c9edfe8b27e (patch)
tree4807e7da43ca4d34633b6ad2db5f2e7b23550524
parent774d075a80c652a0f35a5dd6f9e35cac5b7f6bdd (diff)
ASoC: codec: rt274: 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/20251121140940.40678-4-hariconscious@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/rt274.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/sound/soc/codecs/rt274.c b/sound/soc/codecs/rt274.c
index 5c33aeaced2f..bba714020c70 100644
--- a/sound/soc/codecs/rt274.c
+++ b/sound/soc/codecs/rt274.c
@@ -1189,7 +1189,7 @@ static int rt274_i2c_probe(struct i2c_client *i2c)
regmap_write(rt274->regmap, RT274_UNSOLICITED_MIC, 0x82);
if (rt274->i2c->irq) {
- ret = request_threaded_irq(rt274->i2c->irq, NULL, rt274_irq,
+ ret = devm_request_threaded_irq(&rt274->i2c->dev, rt274->i2c->irq, NULL, rt274_irq,
IRQF_TRIGGER_HIGH | IRQF_ONESHOT, "rt274", rt274);
if (ret != 0) {
dev_err(&i2c->dev,
@@ -1205,15 +1205,6 @@ static int rt274_i2c_probe(struct i2c_client *i2c)
return ret;
}
-static void rt274_i2c_remove(struct i2c_client *i2c)
-{
- struct rt274_priv *rt274 = i2c_get_clientdata(i2c);
-
- if (i2c->irq)
- free_irq(i2c->irq, rt274);
-}
-
-
static struct i2c_driver rt274_i2c_driver = {
.driver = {
.name = "rt274",
@@ -1223,7 +1214,6 @@ static struct i2c_driver rt274_i2c_driver = {
#endif
},
.probe = rt274_i2c_probe,
- .remove = rt274_i2c_remove,
.id_table = rt274_i2c_id,
};