diff options
author | Ajay Kumar Gupta <ajay.gupta@ti.com> | 2010-03-18 16:58:35 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-22 15:18:21 -0700 |
commit | 18f91196b6e7994bd694a96a6c3b0ac1f3e81d82 (patch) | |
tree | 67427edb4565bdb7f6138d98349e6fb6a2c34c04 /drivers/usb/host/ehci-omap.c | |
parent | 4c1f5c88aaffacb2831353b6d3c1557be52071a2 (diff) | |
download | blackbird-op-linux-18f91196b6e7994bd694a96a6c3b0ac1f3e81d82.tar.gz blackbird-op-linux-18f91196b6e7994bd694a96a6c3b0ac1f3e81d82.zip |
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 <ajay.gupta@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ehci-omap.c')
-rw-r--r-- | drivers/usb/host/ehci-omap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index a67a0030dd57..40a858335035 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); |