History

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.

Chuhong Yuan committed 6 years ago

Commit 24dbe0a1 parent a3a06411 file · +7 −11Browse files

Unified · Split

drivers/phy/ti/phy-ti-pipe3.c+7−11
@@ -850,6 +850,12 @@ static int ti_pipe3_probe(struct platform_device *pdev) · 849 unmodified lines
850 850
851static int ti_pipe3_remove(struct platform_device *pdev)851static 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 pm_runtime_disable(&pdev->dev);859 pm_runtime_disable(&pdev->dev);
854 860
855 return 0;861 return 0;
@@ -900,18 +906,8 @@ static void ti_pipe3_disable_clocks(struct ti_pipe3 *phy) · 44 unmodified lines
900{906{
901 if (!IS_ERR(phy->wkupclk))907 if (!IS_ERR(phy->wkupclk))
902 clk_disable_unprepare(phy->wkupclk);908 clk_disable_unprepare(phy->wkupclk);
903 if (!IS_ERR(phy->refclk)) {909 if (!IS_ERR(phy->refclk))
904 clk_disable_unprepare(phy->refclk);910 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
915 if (!IS_ERR(phy->div_clk))911 if (!IS_ERR(phy->div_clk))
916 clk_disable_unprepare(phy->div_clk);912 clk_disable_unprepare(phy->div_clk);
917}913}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t