Skip to content

Commit

Permalink
USB: ehci: omap: fix kernel panic with rmmod
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ajay Kumar Gupta authored and Greg Kroah-Hartman committed Apr 22, 2010
1 parent 4c1f5c8 commit 18f9119
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/usb/host/ehci-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 18f9119

Please sign in to comment.