Skip to content

Commit

Permalink
sdhci-s3c: add missing remove function
Browse files Browse the repository at this point in the history
System will crash sooner or later once the memory with the code of the
s3c-sdhci.ko module is reused for something else. I really have no idea
how the lack of remove function went unnoticed into the mainline code.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Marek Szyprowski authored and Linus Torvalds committed Jul 20, 2010
1 parent d45840d commit 9d51a6b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions drivers/mmc/host/sdhci-s3c.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,26 @@ 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;

sdhci_remove_host(host, 1);

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;
}

Expand Down

0 comments on commit 9d51a6b

Please sign in to comment.