Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Chuhong Yuan and committed by
Kishon Vijay Abraham I
24dbe0aa a3a06415

+7 -11
+7 -11
drivers/phy/ti/phy-ti-pipe3.c
··· 850 850 851 851 static int ti_pipe3_remove(struct platform_device *pdev) 852 852 { 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 + } 853 859 pm_runtime_disable(&pdev->dev); 854 860 855 861 return 0; ··· 906 900 { 907 901 if (!IS_ERR(phy->wkupclk)) 908 902 clk_disable_unprepare(phy->wkupclk); 909 - if (!IS_ERR(phy->refclk)) { 903 + if (!IS_ERR(phy->refclk)) 910 904 clk_disable_unprepare(phy->refclk); 911 - /* 912 - * SATA refclk needs an additional disable as we left it 913 - * on in probe to avoid Errata i783 914 - */ 915 - if (phy->sata_refclk_enabled) { 916 - clk_disable_unprepare(phy->refclk); 917 - phy->sata_refclk_enabled = false; 918 - } 919 - } 920 - 921 905 if (!IS_ERR(phy->div_clk)) 922 906 clk_disable_unprepare(phy->div_clk); 923 907 }