diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-11-22 23:55:30 +0000 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-12-06 13:55:14 -0500 |
commit | c430689f3f0f73e1aadaaf6cfd39930be1e73da1 (patch) | |
tree | 76756175cb86737700599a1fbedbf1085d36f678 /drivers/mmc/host/sdhci-dove.c | |
parent | 7430e77e64000133c50cbd287d44733b4f487dc5 (diff) |
mmc: sdhci-dove: use two-stage initialization for sdhci-pltfm
We need to use the two-stage initialization for sdhci-pltfm if we're
going to do anything extra at initialization time.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-dove.c')
-rw-r--r-- | drivers/mmc/host/sdhci-dove.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/mmc/host/sdhci-dove.c b/drivers/mmc/host/sdhci-dove.c index 4233fd98e3aa..4af64f32c6d1 100644 --- a/drivers/mmc/host/sdhci-dove.c +++ b/drivers/mmc/host/sdhci-dove.c @@ -93,22 +93,32 @@ static int __devinit sdhci_dove_probe(struct platform_device *pdev) } priv->clk = devm_clk_get(&pdev->dev, NULL); - if (!IS_ERR(priv->clk)) - clk_prepare_enable(priv->clk); - ret = sdhci_pltfm_register(pdev, &sdhci_dove_pdata); - if (ret) - goto sdhci_dove_register_fail; + host = sdhci_pltfm_init(pdev, &sdhci_dove_pdata); + if (IS_ERR(host)) { + ret = PTR_ERR(host); + goto err_sdhci_pltfm_init; + } - host = platform_get_drvdata(pdev); pltfm_host = sdhci_priv(host); pltfm_host->priv = priv; + if (!IS_ERR(priv->clk)) + clk_prepare_enable(priv->clk); + + sdhci_get_of_property(pdev); + + ret = sdhci_add_host(host); + if (ret) + goto err_sdhci_add; + return 0; -sdhci_dove_register_fail: +err_sdhci_add: if (!IS_ERR(priv->clk)) clk_disable_unprepare(priv->clk); + sdhci_pltfm_free(pdev); +err_sdhci_pltfm_init: return ret; } |