mirror of
https://github.com/torvalds/linux.git
synced 2026-03-13 22:36:17 +01:00
ASoC: codec: rt298: 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/20251217104356.60839-3-hariconscious@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
dab6b6f5fc
commit
3a4e4e0003
1 changed files with 1 additions and 11 deletions
|
|
@ -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,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue