Skip to contentSkip to conversation

s3c6410: sdhci: Updating sdhci_s3c_remove module exit function

PATCH New thomas.ab at samsung.com 2 participants 2 messages Sep 8, 2009 – Sep 16, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 8/8 s3c6410: sdhci: Updating sdhci_s3c_remove module exit function

From: Thomas Abraham <[email protected]>

This patch populates the sdhci_s3c_remove function in the s3c sdhci driver. This will allow s3c sdhci driver to be used as a module.

---
 drivers/mmc/host/sdhci-s3c.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
drivers/mmc/host/sdhci-s3c.c +26 -0
index 7f5b64e..80e8c38 100644
@@ -380,9 +380,35 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
 
 static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
 {
+	struct sdhci_host *host =  platform_get_drvdata(pdev);
+	struct sdhci_s3c *sc = sdhci_priv(host);
+	int ptr, dead = 0;
+	u32 scratch;
+
+	scratch = readl(host->ioaddr + SDHCI_INT_STATUS);
+	if (scratch == (u32)-1)
+		dead = 1;
+
+	sdhci_remove_host(host, dead);
+
+	for (ptr = 0; ptr < 3; ptr++) {
+		clk_disable(sc->clk_bus[ptr]);
+		clk_put(sc->clk_bus[ptr]);
+	}
+	clk_disable(sc->clk_io);
+	clk_put(sc->clk_io);
+
+	iounmap(host->ioaddr);
+	release_resource(sc->ioarea);
+	kfree(sc->ioarea);
+
+	sdhci_free_host(host);
+	platform_set_drvdata(pdev, NULL);
+
 	return 0;
 }
 
+
 #ifdef CONFIG_PM
 
 static int sdhci_s3c_suspend(struct platform_device *dev, pm_message_t pm)
Signature · 1 line
1.5.3.4
maintainer
#1 lore raw

PATCH 8/8 s3c6410: sdhci: Updating sdhci_s3c_remove module exit function

Quoted 21 lines · On Tue, Sep 08, 2009 at 04:02:35PM +0900, [email protected] wrote:

From: Thomas Abraham <[email protected]>

This patch populates the sdhci_s3c_remove function in the s3c sdhci driver. This will allow s3c sdhci driver to be used as a module.

---
 drivers/mmc/host/sdhci-s3c.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
drivers/mmc/host/sdhci-s3c.c +2 -0
index 7f5b64e..80e8c38 100644
@@ -380,9 +380,35 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
 
 static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
 {
+	struct sdhci_host *host =  platform_get_drvdata(pdev);
+	struct sdhci_s3c *sc = sdhci_priv(host);

drivers/mmc/host/sdhci-s3c.c static int __devinit sdhci_s3c_probe(struct platform_device *pdev) · line 394

Quoted 10 lines
drivers/mmc/host/sdhci-s3c.c +10 -0
+	int ptr, dead = 0;
+	u32 scratch;
+
+	scratch = readl(host->ioaddr + SDHCI_INT_STATUS);
+	if (scratch == (u32)-1)
+		dead = 1;
+
+	sdhci_remove_host(host, dead);
+
+	for (ptr = 0; ptr < 3; ptr++) {

ptr < ARRRAY_SIZE(sc->clk_bus)

you probably also need to check for the validity of the clock and skip it if it is not in used.

Quoted 28 lines
drivers/mmc/host/sdhci-s3c.c +14 -0
+		clk_disable(sc->clk_bus[ptr]);
+		clk_put(sc->clk_bus[ptr]);
+	}
+	clk_disable(sc->clk_io);
+	clk_put(sc->clk_io);
+
+	iounmap(host->ioaddr);
+	release_resource(sc->ioarea);
+	kfree(sc->ioarea);
+
+	sdhci_free_host(host);
+	platform_set_drvdata(pdev, NULL);
+
 	return 0;
 }
 
+
 #ifdef CONFIG_PM
 
 static int sdhci_s3c_suspend(struct platform_device *dev, pm_message_t pm)
Signature · 7 lines
1.5.3.4


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.