]>
Commit | Line | Data |
---|---|---|
bcb3eca5 GKH |
1 | From 9d51a6b2487724e8713cd2794cf09ffeee5f6932 Mon Sep 17 00:00:00 2001 |
2 | From: Marek Szyprowski <m.szyprowski@samsung.com> | |
3 | Date: Tue, 20 Jul 2010 13:24:33 -0700 | |
4 | Subject: sdhci-s3c: add missing remove function | |
5 | ||
6 | From: Marek Szyprowski <m.szyprowski@samsung.com> | |
7 | ||
8 | commit 9d51a6b2487724e8713cd2794cf09ffeee5f6932 upstream. | |
9 | ||
10 | System will crash sooner or later once the memory with the code of the | |
11 | s3c-sdhci.ko module is reused for something else. I really have no idea | |
12 | how the lack of remove function went unnoticed into the mainline code. | |
13 | ||
14 | Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> | |
15 | Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> | |
16 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | |
17 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | |
18 | Signed-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 |