Skip to content

Commit 584259d

Browse files
ahunter6Ulf Hansson
authored andcommitted
mmc: sdhci-dove: Use sdhci_pltfm_remove()
Use sdhci_pltfm_remove() instead of sdhci_pltfm_unregister() so that devm_clk_get_enabled() can be used for pltfm_host->clk. This has the side effect that the order of operations on the error path and remove path is not the same as it was before, but should be safe nevertheless. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230811130351.7038-6-adrian.hunter@intel.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 6996bea commit 584259d

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

drivers/mmc/host/sdhci-dove.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,7 @@ static int sdhci_dove_probe(struct platform_device *pdev)
7575
return PTR_ERR(host);
7676

7777
pltfm_host = sdhci_priv(host);
78-
pltfm_host->clk = devm_clk_get(&pdev->dev, NULL);
79-
80-
if (!IS_ERR(pltfm_host->clk))
81-
clk_prepare_enable(pltfm_host->clk);
78+
pltfm_host->clk = devm_clk_get_enabled(&pdev->dev, NULL);
8279

8380
ret = mmc_of_parse(host->mmc);
8481
if (ret)
@@ -91,7 +88,6 @@ static int sdhci_dove_probe(struct platform_device *pdev)
9188
return 0;
9289

9390
err_sdhci_add:
94-
clk_disable_unprepare(pltfm_host->clk);
9591
sdhci_pltfm_free(pdev);
9692
return ret;
9793
}
@@ -110,7 +106,7 @@ static struct platform_driver sdhci_dove_driver = {
110106
.of_match_table = sdhci_dove_of_match_table,
111107
},
112108
.probe = sdhci_dove_probe,
113-
.remove_new = sdhci_pltfm_unregister,
109+
.remove_new = sdhci_pltfm_remove,
114110
};
115111

116112
module_platform_driver(sdhci_dove_driver);

0 commit comments

Comments
 (0)