[PATCH 05/13] i2c: mv64xxx: Use devm_request_irq()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use devm_request_irq() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@xxxxxxxxxxx>
---
 drivers/i2c/busses/i2c-mv64xxx.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 8be7e42..d94ed5a 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -859,8 +859,8 @@ mv64xxx_i2c_probe(struct platform_device *pd)
 
 	mv64xxx_i2c_hw_init(drv_data);
 
-	rc = request_irq(drv_data->irq, mv64xxx_i2c_intr, 0,
-			 MV64XXX_I2C_CTLR_NAME, drv_data);
+	rc = devm_request_irq(&pd->dev, drv_data->irq, mv64xxx_i2c_intr, 0,
+			      MV64XXX_I2C_CTLR_NAME, drv_data);
 	if (rc) {
 		dev_err(&drv_data->adapter.dev,
 			"mv64xxx: Can't register intr handler irq%d: %d\n",
@@ -869,13 +869,11 @@ mv64xxx_i2c_probe(struct platform_device *pd)
 	} else if ((rc = i2c_add_numbered_adapter(&drv_data->adapter)) != 0) {
 		dev_err(&drv_data->adapter.dev,
 			"mv64xxx: Can't add i2c adapter, rc: %d\n", -rc);
-		goto exit_free_irq;
+		goto exit_clk;
 	}
 
 	return 0;
 
-exit_free_irq:
-	free_irq(drv_data->irq, drv_data);
 exit_clk:
 #if defined(CONFIG_HAVE_CLK)
 	/* Not all platforms have a clk */
@@ -893,7 +891,6 @@ mv64xxx_i2c_remove(struct platform_device *dev)
 	struct mv64xxx_i2c_data		*drv_data = platform_get_drvdata(dev);
 
 	i2c_del_adapter(&drv_data->adapter);
-	free_irq(drv_data->irq, drv_data);
 #if defined(CONFIG_HAVE_CLK)
 	/* Not all platforms have a clk */
 	if (!IS_ERR(drv_data->clk)) {
-- 
1.7.10.4


--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux