From: Madhusudhan Chikkature Date: Fri, 8 Aug 2008 04:13:42 +0000 (+0530) Subject: Fixes required for HSMMC driver to work as module X-Git-Tag: v2.6.26-omap1~6 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=509f205d619490294dc2b2d7c25b987f2e9c2789;p=linux-2.6-omap-h63xx.git Fixes required for HSMMC driver to work as module ARM: OMAP3: Fixes required to make HSMMC driver work as module.Complete the previously applied patch. This patch provides the necessary fixes to make the HSMMC driver work as loadble module. Signed-off-by: Madhusudhan Chikkature Signed-off-by: Romit Dasgupta Signed-off-by: Tony Lindgren --- diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index a8316ffdbbe..1ff51b7060f 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -901,9 +901,26 @@ err: static int omap_mmc_remove(struct platform_device *pdev) { struct mmc_omap_host *host = platform_get_drvdata(pdev); + struct resource *res; + u16 vdd = 0; + + if (!(OMAP_HSMMC_READ(host->base, HCTL) & SDVSDET)) { + /* + * Set the vdd back to 3V, + * applicable for dual volt support. + */ + vdd = fls(host->mmc->ocr_avail) - 1; + if (omap_mmc_switch_opcond(host, vdd) != 0) + host->mmc->ios.vdd = vdd; + } + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (res) + release_mem_region(res->start, res->end - res->start + 1); platform_set_drvdata(pdev, NULL); if (host) { + mmc_remove_host(host->mmc); if (host->pdata->cleanup) host->pdata->cleanup(&pdev->dev); free_irq(host->irq, host);