linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] i2c: imx-lpi2c: add clk_disable_unprepare calls
@ 2019-11-02  6:21 Chuhong Yuan
  2020-03-22 16:19 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Chuhong Yuan @ 2019-11-02  6:21 UTC (permalink / raw)
  Cc: Dong Aisheng, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, linux-i2c, linux-arm-kernel,
	linux-kernel, Chuhong Yuan

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

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
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(+)

diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
index c92b56485fa6..f964693c0901 100644
--- a/drivers/i2c/busses/i2c-imx-lpi2c.c
+++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
@@ -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);
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] i2c: imx-lpi2c: add clk_disable_unprepare calls
  2019-11-02  6:21 [PATCH v2] i2c: imx-lpi2c: add clk_disable_unprepare calls Chuhong Yuan
@ 2020-03-22 16:19 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2020-03-22 16:19 UTC (permalink / raw)
  To: Chuhong Yuan, Dong Aisheng
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, linux-i2c, linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1357 bytes --]

On Sat, Nov 02, 2019 at 02:21:49PM +0800, Chuhong Yuan wrote:
> The driver forgets to call clk_disable_unprepare when probe fails
> and remove.
> Add the two calls to fix the problem.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---

Dong Aisheng, what do you think of this patch?

> 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(+)
> 
> diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
> index c92b56485fa6..f964693c0901 100644
> --- a/drivers/i2c/busses/i2c-imx-lpi2c.c
> +++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
> @@ -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);
> -- 
> 2.23.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-22 16:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-02  6:21 [PATCH v2] i2c: imx-lpi2c: add clk_disable_unprepare calls Chuhong Yuan
2020-03-22 16:19 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).