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

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>

authored by

Adrian Hunter and committed by
Ulf Hansson
584259d4 6996beab

+2 -6
+2 -6
drivers/mmc/host/sdhci-dove.c
··· 75 75 return PTR_ERR(host); 76 76 77 77 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); 82 79 83 80 ret = mmc_of_parse(host->mmc); 84 81 if (ret) ··· 88 91 return 0; 89 92 90 93 err_sdhci_add: 91 - clk_disable_unprepare(pltfm_host->clk); 92 94 sdhci_pltfm_free(pdev); 93 95 return ret; 94 96 } ··· 106 110 .of_match_table = sdhci_dove_of_match_table, 107 111 }, 108 112 .probe = sdhci_dove_probe, 109 - .remove_new = sdhci_pltfm_unregister, 113 + .remove_new = sdhci_pltfm_remove, 110 114 }; 111 115 112 116 module_platform_driver(sdhci_dove_driver);