public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/9] OMAP: HSMMC: Fix oops in omap_mmc_remove
@ 2008-11-21  9:24 Adrian Hunter
  0 siblings, 0 replies; 6+ messages in thread
From: Adrian Hunter @ 2008-11-21  9:24 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap@vger.kernel.org Mailing List

Do not access host in omap_mmc_remove() if it is null.  This
occurs when module is removed before its platform data is set.

Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com>
---
 drivers/mmc/host/omap_hsmmc.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 4bc25c0..f4b7c30 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1128,15 +1128,17 @@ static int omap_mmc_remove(struct platform_device *pdev)
 	struct resource *res;
 	u16 vdd = 0;
 
-	mmc_omap_fclk_state(host, ON);
-	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;
+	if (host) {
+		mmc_omap_fclk_state(host, ON);
+		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);
-- 
1.5.4.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH 0/9] OMAP: HSMMC: Patches
@ 2008-11-21  9:23 Adrian Hunter
  2008-11-21  9:37 ` Adrian Hunter
  0 siblings, 1 reply; 6+ messages in thread
From: Adrian Hunter @ 2008-11-21  9:23 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap@vger.kernel.org Mailing List

Hi

OMAP HSMMC is not ready for mainline, but development is ongoing.

In the meantime these patches are best posted and applied via
omap mailing list and tree.

Regards
Adrian

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-11-21 21:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-21  9:24 [PATCH 5/9] OMAP: HSMMC: Fix oops in omap_mmc_remove Adrian Hunter
  -- strict thread matches above, loose matches on Subject: below --
2008-11-21  9:23 [PATCH 0/9] OMAP: HSMMC: Patches Adrian Hunter
2008-11-21  9:37 ` Adrian Hunter
2008-11-21  9:47   ` [PATCH 5/9] OMAP: HSMMC: Fix oops in omap_mmc_remove Adrian Hunter
2008-11-21  9:55   ` [PATCH 0/9] OMAP: HSMMC: Patches Adrian Hunter
2008-11-21  9:58     ` [PATCH 5/9] OMAP: HSMMC: Fix oops in omap_mmc_remove Adrian Hunter
2008-11-21 14:03       ` Grazvydas Ignotas
2008-11-21 15:27         ` Jarkko Lavinen
2008-11-21 21:08           ` Grazvydas Ignotas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox