summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-03-01 01:32:29 +0400
committerChris Ball <chris@printf.net>2014-03-05 01:28:28 +0400
commit142dbab951fb9d2281e69f8d7522e6b7e0553ec0 (patch)
tree845531fbf9d0e7be23dff64f1ff072ae1d9ff74c
parent4025ce24f326830135341814307c072f6c2a7738 (diff)
downloadlinux-142dbab951fb9d2281e69f8d7522e6b7e0553ec0.tar.xz
mmc: sdhci-spear: fix error handling paths for DT
Fix the error handling paths for DT and simplify using the devm_* API for clk_get(). Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Chris Ball <chris@printf.net>
-rw-r--r--drivers/mmc/host/sdhci-spear.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
index 76ddd89a688e..394714f71b2f 100644
--- a/drivers/mmc/host/sdhci-spear.c
+++ b/drivers/mmc/host/sdhci-spear.c
@@ -129,7 +129,7 @@ static int sdhci_probe(struct platform_device *pdev)
}
/* clk enable */
- sdhci->clk = clk_get(&pdev->dev, NULL);
+ sdhci->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(sdhci->clk)) {
ret = PTR_ERR(sdhci->clk);
dev_dbg(&pdev->dev, "Error getting clock\n");
@@ -139,7 +139,7 @@ static int sdhci_probe(struct platform_device *pdev)
ret = clk_prepare_enable(sdhci->clk);
if (ret) {
dev_dbg(&pdev->dev, "Error enabling clock\n");
- goto put_clk;
+ goto err;
}
ret = clk_set_rate(sdhci->clk, 50000000);
@@ -151,7 +151,7 @@ static int sdhci_probe(struct platform_device *pdev)
sdhci->data = sdhci_probe_config_dt(pdev);
if (IS_ERR(sdhci->data)) {
dev_err(&pdev->dev, "DT: Failed to get pdata\n");
- return -ENODEV;
+ goto disable_clk;
}
} else {
sdhci->data = dev_get_platdata(&pdev->dev);
@@ -261,8 +261,6 @@ free_host:
sdhci_free_host(host);
disable_clk:
clk_disable_unprepare(sdhci->clk);
-put_clk:
- clk_put(sdhci->clk);
err:
dev_err(&pdev->dev, "spear-sdhci probe failed: %d\n", ret);
return ret;
@@ -282,7 +280,6 @@ static int sdhci_remove(struct platform_device *pdev)
sdhci_remove_host(host, dead);
sdhci_free_host(host);
clk_disable_unprepare(sdhci->clk);
- clk_put(sdhci->clk);
return 0;
}