aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorShawn Lin <shawn.lin@rock-chips.com>2016-03-07 23:39:08 +0800
committerUlf Hansson <ulf.hansson@linaro.org>2016-03-17 14:54:39 +0100
commit278d09624eda94d82ff385b1c40ecc3db99c73d3 (patch)
tree8b53cfa04b642ca754ad28242b8181202e1d70d2 /drivers/mmc
parentmmc: sdhci-of-arasan: remove disable clk_ahb from sdhci_arasan_resume (diff)
downloadlinux-dev-278d09624eda94d82ff385b1c40ecc3db99c73d3.tar.xz
linux-dev-278d09624eda94d82ff385b1c40ecc3db99c73d3.zip
mmc: sdhci-of-arasan: fix missing sdhci_pltfm_free for err handling
Currently, some err handling of sdhci_arasan_probe return directly without calling sdhci_pltfm_free. This patch fixes them. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci-of-arasan.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
index ae8052d41ad9..91b7c62324b5 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -147,19 +147,21 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
sdhci_arasan->clk_ahb = devm_clk_get(&pdev->dev, "clk_ahb");
if (IS_ERR(sdhci_arasan->clk_ahb)) {
dev_err(&pdev->dev, "clk_ahb clock not found.\n");
- return PTR_ERR(sdhci_arasan->clk_ahb);
+ ret = PTR_ERR(sdhci_arasan->clk_ahb);
+ goto err_pltfm_free;
}
clk_xin = devm_clk_get(&pdev->dev, "clk_xin");
if (IS_ERR(clk_xin)) {
dev_err(&pdev->dev, "clk_xin clock not found.\n");
- return PTR_ERR(clk_xin);
+ ret = PTR_ERR(clk_xin);
+ goto err_pltfm_free;
}
ret = clk_prepare_enable(sdhci_arasan->clk_ahb);
if (ret) {
dev_err(&pdev->dev, "Unable to enable AHB clock.\n");
- return ret;
+ goto err_pltfm_free;
}
ret = clk_prepare_enable(clk_xin);
@@ -179,17 +181,16 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
ret = sdhci_add_host(host);
if (ret)
- goto err_pltfm_free;
+ goto clk_disable_all;
return 0;
-err_pltfm_free:
- sdhci_pltfm_free(pdev);
clk_disable_all:
clk_disable_unprepare(clk_xin);
clk_dis_ahb:
clk_disable_unprepare(sdhci_arasan->clk_ahb);
-
+err_pltfm_free:
+ sdhci_pltfm_free(pdev);
return ret;
}