Commit a4ce47f1 authored by Fabio Estevam's avatar Fabio Estevam Committed by Wolfram Sang

i2c-imx: Disable the clock on probe failure

In the case of errors during probe, we should disable i2c_imx->clk.
Signed-off-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent a445900c
...@@ -710,7 +710,7 @@ static int i2c_imx_probe(struct platform_device *pdev) ...@@ -710,7 +710,7 @@ static int i2c_imx_probe(struct platform_device *pdev)
pdev->name, i2c_imx); pdev->name, i2c_imx);
if (ret) { if (ret) {
dev_err(&pdev->dev, "can't claim irq %d\n", irq); dev_err(&pdev->dev, "can't claim irq %d\n", irq);
return ret; goto clk_disable;
} }
/* Init queue */ /* Init queue */
...@@ -735,7 +735,7 @@ static int i2c_imx_probe(struct platform_device *pdev) ...@@ -735,7 +735,7 @@ static int i2c_imx_probe(struct platform_device *pdev)
ret = i2c_add_numbered_adapter(&i2c_imx->adapter); ret = i2c_add_numbered_adapter(&i2c_imx->adapter);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "registration failed\n"); dev_err(&pdev->dev, "registration failed\n");
return ret; goto clk_disable;
} }
/* Set up platform driver data */ /* Set up platform driver data */
...@@ -749,6 +749,10 @@ static int i2c_imx_probe(struct platform_device *pdev) ...@@ -749,6 +749,10 @@ static int i2c_imx_probe(struct platform_device *pdev)
dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n"); dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n");
return 0; /* Return OK */ return 0; /* Return OK */
clk_disable:
clk_disable_unprepare(i2c_imx->clk);
return ret;
} }
static int i2c_imx_remove(struct platform_device *pdev) static int i2c_imx_remove(struct platform_device *pdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment