linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: ti-pipe3: fix missed clk_disable_unprepare in remove
@ 2019-12-04  7:25 Chuhong Yuan
  2019-12-04  8:39 ` Roger Quadros
  0 siblings, 1 reply; 2+ messages in thread
From: Chuhong Yuan @ 2019-12-04  7:25 UTC (permalink / raw)
  Cc: Kishon Vijay Abraham I, Roger Quadros, linux-kernel, Chuhong Yuan

The driver calls clk_prepare_enable in probe but forgets to call
clk_disable_unprepare in remove.
Add the missed call to fix it.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 drivers/phy/ti/phy-ti-pipe3.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/phy/ti/phy-ti-pipe3.c b/drivers/phy/ti/phy-ti-pipe3.c
index edd6859afba8..19fd1005a440 100644
--- a/drivers/phy/ti/phy-ti-pipe3.c
+++ b/drivers/phy/ti/phy-ti-pipe3.c
@@ -850,6 +850,12 @@ static int ti_pipe3_probe(struct platform_device *pdev)
 
 static int ti_pipe3_remove(struct platform_device *pdev)
 {
+	struct ti_pipe3 *phy = platform_get_drvdata(pdev);
+
+	if (phy->mode == PIPE3_MODE_SATA) {
+		clk_disable_unprepare(phy->refclk);
+		phy->sata_refclk_enabled = false;
+	}
 	pm_runtime_disable(&pdev->dev);
 
 	return 0;
-- 
2.24.0


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

* Re: [PATCH] phy: ti-pipe3: fix missed clk_disable_unprepare in remove
  2019-12-04  7:25 [PATCH] phy: ti-pipe3: fix missed clk_disable_unprepare in remove Chuhong Yuan
@ 2019-12-04  8:39 ` Roger Quadros
  0 siblings, 0 replies; 2+ messages in thread
From: Roger Quadros @ 2019-12-04  8:39 UTC (permalink / raw)
  To: Chuhong Yuan; +Cc: Kishon Vijay Abraham I, linux-kernel

Hi Chuhong,

On 04/12/2019 09:25, Chuhong Yuan wrote:
> The driver calls clk_prepare_enable in probe but forgets to call
> clk_disable_unprepare in remove.
> Add the missed call to fix it.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
>   drivers/phy/ti/phy-ti-pipe3.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/phy/ti/phy-ti-pipe3.c b/drivers/phy/ti/phy-ti-pipe3.c
> index edd6859afba8..19fd1005a440 100644
> --- a/drivers/phy/ti/phy-ti-pipe3.c
> +++ b/drivers/phy/ti/phy-ti-pipe3.c
> @@ -850,6 +850,12 @@ static int ti_pipe3_probe(struct platform_device *pdev)
>   
>   static int ti_pipe3_remove(struct platform_device *pdev)
>   {
> +	struct ti_pipe3 *phy = platform_get_drvdata(pdev);
> +
> +	if (phy->mode == PIPE3_MODE_SATA) {
> +		clk_disable_unprepare(phy->refclk);
> +		phy->sata_refclk_enabled = false;
> +	}

In fact we are doing an additional disable in ti_pipe3_disable_clocks()
for SATA case.

I think that piece of code should removed if you implement it in
ti_pipe3_remove().
Also commit log should be updated accordingly.

>   	pm_runtime_disable(&pdev->dev);
>   
>   	return 0;
> 

-- 
cheers,
-roger
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

end of thread, other threads:[~2019-12-04  8:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-04  7:25 [PATCH] phy: ti-pipe3: fix missed clk_disable_unprepare in remove Chuhong Yuan
2019-12-04  8:39 ` Roger Quadros

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).