Skip to content

Commit 3f37713

Browse files
ahunter6Ulf Hansson
authored andcommitted
mmc: sdhci-iproc: 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-8-adrian.hunter@intel.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 080b5ad commit 3f37713

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

drivers/mmc/host/sdhci-iproc.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -386,16 +386,11 @@ static int sdhci_iproc_probe(struct platform_device *pdev)
386386
host->mmc->caps |= iproc_host->data->mmc_caps;
387387

388388
if (dev->of_node) {
389-
pltfm_host->clk = devm_clk_get(dev, NULL);
389+
pltfm_host->clk = devm_clk_get_enabled(dev, NULL);
390390
if (IS_ERR(pltfm_host->clk)) {
391391
ret = PTR_ERR(pltfm_host->clk);
392392
goto err;
393393
}
394-
ret = clk_prepare_enable(pltfm_host->clk);
395-
if (ret) {
396-
dev_err(dev, "failed to enable host clk\n");
397-
goto err;
398-
}
399394
}
400395

401396
if (iproc_host->data->missing_caps) {
@@ -406,13 +401,10 @@ static int sdhci_iproc_probe(struct platform_device *pdev)
406401

407402
ret = sdhci_add_host(host);
408403
if (ret)
409-
goto err_clk;
404+
goto err;
410405

411406
return 0;
412407

413-
err_clk:
414-
if (dev->of_node)
415-
clk_disable_unprepare(pltfm_host->clk);
416408
err:
417409
sdhci_pltfm_free(pdev);
418410
return ret;
@@ -432,7 +424,7 @@ static struct platform_driver sdhci_iproc_driver = {
432424
.pm = &sdhci_pltfm_pmops,
433425
},
434426
.probe = sdhci_iproc_probe,
435-
.remove_new = sdhci_pltfm_unregister,
427+
.remove_new = sdhci_pltfm_remove,
436428
.shutdown = sdhci_iproc_shutdown,
437429
};
438430
module_platform_driver(sdhci_iproc_driver);

0 commit comments

Comments
 (0)