Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1351731 > unrolled thread

[PATCH v7 3/4] mmc: sdhci-of-arasan: fix missing sdhci_pltfm_free for err handling

Started byShawn Lin <shawn.lin@rock-chips.com>
First post2016-03-07 16:50 +0100
Last post2016-03-08 15:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v7 3/4] mmc: sdhci-of-arasan: fix missing sdhci_pltfm_free for err handling Shawn Lin <shawn.lin@rock-chips.com> - 2016-03-07 16:50 +0100
    Re: [PATCH v7 3/4] mmc: sdhci-of-arasan: fix missing sdhci_pltfm_free  for err handling Adrian Hunter <adrian.hunter@intel.com> - 2016-03-08 15:00 +0100

#1351731 — [PATCH v7 3/4] mmc: sdhci-of-arasan: fix missing sdhci_pltfm_free for err handling

FromShawn Lin <shawn.lin@rock-chips.com>
Date2016-03-07 16:50 +0100
Subject[PATCH v7 3/4] mmc: sdhci-of-arasan: fix missing sdhci_pltfm_free for err handling
Message-ID<ra5zZ-4I3-27@gated-at.bofh.it>
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>
---

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/mmc/host/sdhci-of-arasan.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
index ae8052d..91b7c62 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;
 }
 
-- 
2.3.7

[toc] | [next] | [standalone]


#1353067 — Re: [PATCH v7 3/4] mmc: sdhci-of-arasan: fix missing sdhci_pltfm_free for err handling

FromAdrian Hunter <adrian.hunter@intel.com>
Date2016-03-08 15:00 +0100
SubjectRe: [PATCH v7 3/4] mmc: sdhci-of-arasan: fix missing sdhci_pltfm_free for err handling
Message-ID<raql5-1Bi-35@gated-at.bofh.it>
In reply to#1351731
On 07/03/16 17:39, Shawn Lin wrote:
> 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>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web