From: Ajay Kumar Gupta Date: Thu, 18 Mar 2010 11:28:35 +0000 (+0530) Subject: USB: ehci: omap: fix kernel panic with rmmod X-Git-Tag: v2.6.34-rc6~60^2~9 X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=commitdiff_plain;h=18f91196b6e7994bd694a96a6c3b0ac1f3e81d82 USB: ehci: omap: fix kernel panic with rmmod Sets the regulator values to NULL if they are not defined. This is required to fix the kernel panic in exit path when EHCI module is removed on the platforms where EHCI regulator are not set. Signed-off-by: Ajay Kumar Gupta Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index a67a003..40a8583 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c @@ -629,11 +629,13 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) } snprintf(supply, sizeof(supply), "hsusb%d", i); omap->regulator[i] = regulator_get(omap->dev, supply); - if (IS_ERR(omap->regulator[i])) + if (IS_ERR(omap->regulator[i])) { + omap->regulator[i] = NULL; dev_dbg(&pdev->dev, "failed to get ehci port%d regulator\n", i); - else + } else { regulator_enable(omap->regulator[i]); + } } ret = omap_start_ehc(omap, hcd);