]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.32.17/sdhci-s3c-add-missing-remove-function.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.17 / sdhci-s3c-add-missing-remove-function.patch
CommitLineData
bcb3eca5
GKH
1From 9d51a6b2487724e8713cd2794cf09ffeee5f6932 Mon Sep 17 00:00:00 2001
2From: Marek Szyprowski <m.szyprowski@samsung.com>
3Date: Tue, 20 Jul 2010 13:24:33 -0700
4Subject: sdhci-s3c: add missing remove function
5
6From: Marek Szyprowski <m.szyprowski@samsung.com>
7
8commit 9d51a6b2487724e8713cd2794cf09ffeee5f6932 upstream.
9
10System will crash sooner or later once the memory with the code of the
11s3c-sdhci.ko module is reused for something else. I really have no idea
12how the lack of remove function went unnoticed into the mainline code.
13
14Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
15Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
16Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
17Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
18Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
19
20---
21 drivers/mmc/host/sdhci-s3c.c | 20 ++++++++++++++++++++
22 1 file changed, 20 insertions(+)
23
24--- a/drivers/mmc/host/sdhci-s3c.c
25+++ b/drivers/mmc/host/sdhci-s3c.c
26@@ -372,6 +372,26 @@ static int __devinit sdhci_s3c_probe(str
27
28 static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
29 {
30+ struct sdhci_host *host = platform_get_drvdata(pdev);
31+ struct sdhci_s3c *sc = sdhci_priv(host);
32+ int ptr;
33+
34+ sdhci_remove_host(host, 1);
35+
36+ for (ptr = 0; ptr < 3; ptr++) {
37+ clk_disable(sc->clk_bus[ptr]);
38+ clk_put(sc->clk_bus[ptr]);
39+ }
40+ clk_disable(sc->clk_io);
41+ clk_put(sc->clk_io);
42+
43+ iounmap(host->ioaddr);
44+ release_resource(sc->ioarea);
45+ kfree(sc->ioarea);
46+
47+ sdhci_free_host(host);
48+ platform_set_drvdata(pdev, NULL);
49+
50 return 0;
51 }
52