summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2014-10-04 09:17:27 -0300
committerWolfram Sang <wsa@the-dreams.de>2014-10-06 19:59:55 +0200
commita4ce47f108a6df129c9f4345c6dda0473cb68da5 (patch)
tree9f8bd23aae388b9a3f0b78014690a9448909a466 /drivers/i2c
parenta445900c906092f3b49ee40a7365d0d54acc568e (diff)
downloadlinux-a4ce47f108a6df129c9f4345c6dda0473cb68da5.tar.bz2
i2c-imx: Disable the clock on probe failure
In the case of errors during probe, we should disable i2c_imx->clk. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-imx.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index ceff87cec18e..c48e46af670a 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -710,7 +710,7 @@ static int i2c_imx_probe(struct platform_device *pdev)
pdev->name, i2c_imx);
if (ret) {
dev_err(&pdev->dev, "can't claim irq %d\n", irq);
- return ret;
+ goto clk_disable;
}
/* Init queue */
@@ -735,7 +735,7 @@ static int i2c_imx_probe(struct platform_device *pdev)
ret = i2c_add_numbered_adapter(&i2c_imx->adapter);
if (ret < 0) {
dev_err(&pdev->dev, "registration failed\n");
- return ret;
+ goto clk_disable;
}
/* Set up platform driver data */
@@ -749,6 +749,10 @@ static int i2c_imx_probe(struct platform_device *pdev)
dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n");
return 0; /* Return OK */
+
+clk_disable:
+ clk_disable_unprepare(i2c_imx->clk);
+ return ret;
}
static int i2c_imx_remove(struct platform_device *pdev)