Skip to content

Commit 24dbe0a

Browse files
WillLesterkishon
authored andcommitted
phy: ti-pipe3: make clk operations symmetric in probe and remove
The driver calls clk_prepare_enable in probe but the corresponding clk_disable_unprepare() is in ti_pipe3_disable_clocks(). Move clk_disable_unprepare() to remove to make them symmetric. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Acked-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
1 parent a3a0641 commit 24dbe0a

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

‎drivers/phy/ti/phy-ti-pipe3.c‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,12 @@ static int ti_pipe3_probe(struct platform_device *pdev)
850850

851851
static int ti_pipe3_remove(struct platform_device *pdev)
852852
{
853+
struct ti_pipe3 *phy = platform_get_drvdata(pdev);
854+
855+
if (phy->mode == PIPE3_MODE_SATA) {
856+
clk_disable_unprepare(phy->refclk);
857+
phy->sata_refclk_enabled = false;
858+
}
853859
pm_runtime_disable(&pdev->dev);
854860

855861
return 0;
@@ -900,18 +906,8 @@ static void ti_pipe3_disable_clocks(struct ti_pipe3 *phy)
900906
{
901907
if (!IS_ERR(phy->wkupclk))
902908
clk_disable_unprepare(phy->wkupclk);
903-
if (!IS_ERR(phy->refclk)) {
909+
if (!IS_ERR(phy->refclk))
904910
clk_disable_unprepare(phy->refclk);
905-
/*
906-
* SATA refclk needs an additional disable as we left it
907-
* on in probe to avoid Errata i783
908-
*/
909-
if (phy->sata_refclk_enabled) {
910-
clk_disable_unprepare(phy->refclk);
911-
phy->sata_refclk_enabled = false;
912-
}
913-
}
914-
915911
if (!IS_ERR(phy->div_clk))
916912
clk_disable_unprepare(phy->div_clk);
917913
}

0 commit comments

Comments
 (0)