linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MMC: fix sdhci-dove removal
@ 2012-10-15  9:43 Russell King - ARM Linux
  2012-10-15 10:37 ` Russell King - ARM Linux
  0 siblings, 1 reply; 10+ messages in thread
From: Russell King - ARM Linux @ 2012-10-15  9:43 UTC (permalink / raw)
  To: linux-arm-kernel

1. Unregister the device _BEFORE_ taking away any resources it may
   be using.
2. Don't check clks against NULL.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
I noticed this while merging v3.6 into Rabeeh's cubox kernel.

 drivers/mmc/host/sdhci-dove.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/sdhci-dove.c b/drivers/mmc/host/sdhci-dove.c
index 90140eb..c11db64 100644
--- a/drivers/mmc/host/sdhci-dove.c
+++ b/drivers/mmc/host/sdhci-dove.c
@@ -117,14 +117,13 @@ static int __devexit sdhci_dove_remove(struct platform_device *pdev)
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
 	struct sdhci_dove_priv *priv = pltfm_host->priv;
 
-	if (priv->clk) {
-		if (!IS_ERR(priv->clk)) {
-			clk_disable_unprepare(priv->clk);
-			clk_put(priv->clk);
-		}
-		devm_kfree(&pdev->dev, priv->clk);
+	sdhci_pltfm_unregister(pdev);
+
+	if (!IS_ERR(priv->clk)) {
+		clk_disable_unprepare(priv->clk);
+		clk_put(priv->clk);
 	}
-	return sdhci_pltfm_unregister(pdev);
+	return 0;
 }
 
 static const struct of_device_id sdhci_dove_of_match_table[] __devinitdata = {

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-10-29 22:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-15  9:43 [PATCH] MMC: fix sdhci-dove removal Russell King - ARM Linux
2012-10-15 10:37 ` Russell King - ARM Linux
2012-10-15 10:44   ` Russell King - ARM Linux
2012-10-15 14:58     ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-15 15:07       ` Russell King - ARM Linux
2012-10-29 21:10     ` Chris Ball
2012-10-29 21:43       ` Russell King - ARM Linux
2012-10-29 21:49         ` Chris Ball
2012-10-29 22:16           ` Sebastian Hesselbarth
2012-10-29 22:20             ` Chris Ball

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).