diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-02-28 16:32:29 -0500 |
---|---|---|
committer | Chris Ball <chris@printf.net> | 2014-03-04 16:28:28 -0500 |
commit | 142dbab951fb9d2281e69f8d7522e6b7e0553ec0 (patch) | |
tree | 845531fbf9d0e7be23dff64f1ff072ae1d9ff74c /drivers/mmc | |
parent | 4025ce24f326830135341814307c072f6c2a7738 (diff) |
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>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/sdhci-spear.c | 9 |
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) | |||
129 | } | 129 | } |
130 | 130 | ||
131 | /* clk enable */ | 131 | /* clk enable */ |
132 | sdhci->clk = clk_get(&pdev->dev, NULL); | 132 | sdhci->clk = devm_clk_get(&pdev->dev, NULL); |
133 | if (IS_ERR(sdhci->clk)) { | 133 | if (IS_ERR(sdhci->clk)) { |
134 | ret = PTR_ERR(sdhci->clk); | 134 | ret = PTR_ERR(sdhci->clk); |
135 | dev_dbg(&pdev->dev, "Error getting clock\n"); | 135 | dev_dbg(&pdev->dev, "Error getting clock\n"); |
@@ -139,7 +139,7 @@ static int sdhci_probe(struct platform_device *pdev) | |||
139 | ret = clk_prepare_enable(sdhci->clk); | 139 | ret = clk_prepare_enable(sdhci->clk); |
140 | if (ret) { | 140 | if (ret) { |
141 | dev_dbg(&pdev->dev, "Error enabling clock\n"); | 141 | dev_dbg(&pdev->dev, "Error enabling clock\n"); |
142 | goto put_clk; | 142 | goto err; |
143 | } | 143 | } |
144 | 144 | ||
145 | ret = clk_set_rate(sdhci->clk, 50000000); | 145 | ret = clk_set_rate(sdhci->clk, 50000000); |
@@ -151,7 +151,7 @@ static int sdhci_probe(struct platform_device *pdev) | |||
151 | sdhci->data = sdhci_probe_config_dt(pdev); | 151 | sdhci->data = sdhci_probe_config_dt(pdev); |
152 | if (IS_ERR(sdhci->data)) { | 152 | if (IS_ERR(sdhci->data)) { |
153 | dev_err(&pdev->dev, "DT: Failed to get pdata\n"); | 153 | dev_err(&pdev->dev, "DT: Failed to get pdata\n"); |
154 | return -ENODEV; | 154 | goto disable_clk; |
155 | } | 155 | } |
156 | } else { | 156 | } else { |
157 | sdhci->data = dev_get_platdata(&pdev->dev); | 157 | sdhci->data = dev_get_platdata(&pdev->dev); |
@@ -261,8 +261,6 @@ free_host: | |||
261 | sdhci_free_host(host); | 261 | sdhci_free_host(host); |
262 | disable_clk: | 262 | disable_clk: |
263 | clk_disable_unprepare(sdhci->clk); | 263 | clk_disable_unprepare(sdhci->clk); |
264 | put_clk: | ||
265 | clk_put(sdhci->clk); | ||
266 | err: | 264 | err: |
267 | dev_err(&pdev->dev, "spear-sdhci probe failed: %d\n", ret); | 265 | dev_err(&pdev->dev, "spear-sdhci probe failed: %d\n", ret); |
268 | return ret; | 266 | return ret; |
@@ -282,7 +280,6 @@ static int sdhci_remove(struct platform_device *pdev) | |||
282 | sdhci_remove_host(host, dead); | 280 | sdhci_remove_host(host, dead); |
283 | sdhci_free_host(host); | 281 | sdhci_free_host(host); |
284 | clk_disable_unprepare(sdhci->clk); | 282 | clk_disable_unprepare(sdhci->clk); |
285 | clk_put(sdhci->clk); | ||
286 | 283 | ||
287 | return 0; | 284 | return 0; |
288 | } | 285 | } |