Skip to contentSkip to conversation

phy: ti-pipe3: fix missed clk_disable_unprepare in remove

PATCH In review Chuhong Yuan 2 participants 2 messages Dec 4, 2019 Generic PHY framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phy: ti-pipe3: fix missed clk_disable_unprepare in remove

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

---
 drivers/phy/ti/phy-ti-pipe3.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/phy/ti/phy-ti-pipe3.c +6 -0
index edd6859afba8..19fd1005a440 100644
@@ -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;
Signature · 1 line
2.24.0
#1 lore raw

Hi Chuhong,

Quoted 14 lines · 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.

---
  drivers/phy/ti/phy-ti-pipe3.c | 6 ++++++
  1 file changed, 6 insertions(+)
drivers/phy/ti/phy-ti-pipe3.c +0 -0
index edd6859afba8..19fd1005a440 100644

drivers/phy/ti/phy-ti-pipe3.c static int ti_pipe3_probe(struct platform_device *pdev) · line 858

Quoted 9 lines
drivers/phy/ti/phy-ti-pipe3.c +6 -0
@@ -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.

Quoted 4 lines
drivers/phy/ti/phy-ti-pipe3.c +0 -0
  	pm_runtime_disable(&pdev->dev);
 
  	return 0;
Signature · 4 lines
cheers,
-roger
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki