[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1544143788-22606-1-git-send-email-j-keerthy@ti.com>
Date: Fri, 7 Dec 2018 06:19:48 +0530
From: Keerthy <j-keerthy@...com>
To: <tony@...mide.com>, <lee.jones@...aro.org>
CC: <sebastian.reichel@...labora.com>, <Christian.Hohnstaedt@...o.com>,
<t-kristo@...com>, <j-keerthy@...com>,
<linux-omap@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH v2] tps65218: Use devm_regmap_add_irq_chip and clean up error path in probe
Use devm_regmap_add_irq_chip and clean up error path in probe.
Hence clean up the probe error path and the remove function.
Reported-by: Christian Hohnstaedt <Christian.Hohnstaedt@...o.com>
Signed-off-by: Keerthy <j-keerthy@...com>
---
Changes in v2:
* Cleaned up remove function as well.
drivers/mfd/tps65218.c | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/drivers/mfd/tps65218.c b/drivers/mfd/tps65218.c
index 910f569..d2d4e3a 100644
--- a/drivers/mfd/tps65218.c
+++ b/drivers/mfd/tps65218.c
@@ -235,9 +235,9 @@ static int tps65218_probe(struct i2c_client *client,
mutex_init(&tps->tps_lock);
- ret = regmap_add_irq_chip(tps->regmap, tps->irq,
- IRQF_ONESHOT, 0, &tps65218_irq_chip,
- &tps->irq_data);
+ ret = devm_regmap_add_irq_chip(&client->dev, tps->regmap, tps->irq,
+ IRQF_ONESHOT, 0, &tps65218_irq_chip,
+ &tps->irq_data);
if (ret < 0)
return ret;
@@ -253,23 +253,11 @@ static int tps65218_probe(struct i2c_client *client,
ARRAY_SIZE(tps65218_cells), NULL, 0,
regmap_irq_get_domain(tps->irq_data));
- if (ret < 0)
- goto err_irq;
-
- return 0;
-
-err_irq:
- regmap_del_irq_chip(tps->irq, tps->irq_data);
-
return ret;
}
static int tps65218_remove(struct i2c_client *client)
{
- struct tps65218 *tps = i2c_get_clientdata(client);
-
- regmap_del_irq_chip(tps->irq, tps->irq_data);
-
return 0;
}
--
1.9.1
Powered by blists - more mailing lists