Skip to contentSkip to conversation

i2c: imx-lpi2c: add clk_disable_unprepare calls

PATCH In review Chuhong Yuan 2 participants 2 messages Nov 2, 2019 – Mar 22, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 i2c: imx-lpi2c: add clk_disable_unprepare calls

The driver forgets to call clk_disable_unprepare when probe fails and remove.
Add the two calls to fix the problem.

---
Changes in v2:
- Adjust the call order to make it consistent in probe failure and removal.

 drivers/i2c/busses/i2c-imx-lpi2c.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/i2c/busses/i2c-imx-lpi2c.c +2 -0
index c92b56485fa6..f964693c0901 100644
@@ -618,6 +618,7 @@ static int lpi2c_imx_probe(struct platform_device *pdev)
 	return 0;
 
 rpm_disable:
+	clk_disable_unprepare(lpi2c_imx->clk);
 	pm_runtime_put(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_dont_use_autosuspend(&pdev->dev);
@@ -630,6 +631,7 @@ static int lpi2c_imx_remove(struct platform_device *pdev)
 	struct lpi2c_imx_struct *lpi2c_imx = platform_get_drvdata(pdev);
 
 	i2c_del_adapter(&lpi2c_imx->adapter);
+	clk_disable_unprepare(lpi2c_imx->clk);
 
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_dont_use_autosuspend(&pdev->dev);
Signature · 1 line
2.23.0
#1 lore raw
Quoted 6 lines · Chuhong Yuan

The driver forgets to call clk_disable_unprepare when probe fails and remove.
Add the two calls to fix the problem.

---

Dong Aisheng, what do you think of this patch?

Quoted 30 lines

Changes in v2:
- Adjust the call order to make it consistent in probe failure and removal.

 drivers/i2c/busses/i2c-imx-lpi2c.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/i2c/busses/i2c-imx-lpi2c.c +2 -0
index c92b56485fa6..f964693c0901 100644
@@ -618,6 +618,7 @@ static int lpi2c_imx_probe(struct platform_device *pdev)
 	return 0;
 
 rpm_disable:
+	clk_disable_unprepare(lpi2c_imx->clk);
 	pm_runtime_put(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_dont_use_autosuspend(&pdev->dev);
@@ -630,6 +631,7 @@ static int lpi2c_imx_remove(struct platform_device *pdev)
 	struct lpi2c_imx_struct *lpi2c_imx = platform_get_drvdata(pdev);
 
 	i2c_del_adapter(&lpi2c_imx->adapter);
+	clk_disable_unprepare(lpi2c_imx->clk);
 
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_dont_use_autosuspend(&pdev->dev);
Signature · 1 line
2.23.0