[PATCH] mfd: tc3589x: Use devm_request_threaded_irq() to fix the missing undo bug

From: Chuhong Yuan
Date: Sat Jun 06 2020 - 10:39:53 EST


This driver calls request_threaded_irq() in probe, but it misses calling
free_irq() in probe's error handler and remove.
Replace request_threaded_irq() with the devm version to fix it.

Fixes: 20406ebff4a2 ("mfd/tc3589x: rename tc35892 structs/registers to tc359x")
Signed-off-by: Chuhong Yuan <hslester96@xxxxxxxxx>
---
drivers/mfd/tc3589x.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c
index 67c9995bb1aa..0fd8ba1c68d0 100644
--- a/drivers/mfd/tc3589x.c
+++ b/drivers/mfd/tc3589x.c
@@ -412,9 +412,9 @@ static int tc3589x_probe(struct i2c_client *i2c,
if (ret)
return ret;

- ret = request_threaded_irq(tc3589x->i2c->irq, NULL, tc3589x_irq,
- IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
- "tc3589x", tc3589x);
+ ret = devm_request_threaded_irq(&i2c->dev, tc3589x->i2c->irq, NULL,
+ tc3589x_irq, IRQF_TRIGGER_FALLING |
+ IRQF_ONESHOT, "tc3589x", tc3589x);
if (ret) {
dev_err(tc3589x->dev, "failed to request IRQ: %d\n", ret);
return ret;
--
2.26.2