summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/omap-usb-host.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-05-14 08:15:36 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2011-05-26 19:45:50 +0200
commitd910774f13678caf68fc9cbbef325f08f7f951a3 (patch)
treebfe5198e0bffeef1f35fe5dade2fc48bc8c9eba8 /drivers/mfd/omap-usb-host.c
parentmfd: Fix omap usbhs crash when rmmoding ehci or ohci (diff)
downloadlinux-d910774f13678caf68fc9cbbef325f08f7f951a3.tar.xz
linux-d910774f13678caf68fc9cbbef325f08f7f951a3.zip
mfd: Fix omap_usbhs_alloc_children error handling
1. Return proper error if omap_usbhs_alloc_child fails 2. In the case of goto err_ehci, we should call platform_device_unregister(ehci) instead of platform_device_put(ehci) because we have already added the platform device to device hierarchy. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Axel Lin <axel.lin@gmail.com> Tested-by: Keshava Munegowda <keshava_mgowda@ti.com> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to '')
-rw-r--r--drivers/mfd/omap-usb-host.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 55c5d4732f5f..1717144fe7f4 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -281,6 +281,7 @@ static int omap_usbhs_alloc_children(struct platform_device *pdev)
if (!ehci) {
dev_err(dev, "omap_usbhs_alloc_child failed\n");
+ ret = -ENOMEM;
goto err_end;
}
@@ -304,13 +305,14 @@ static int omap_usbhs_alloc_children(struct platform_device *pdev)
sizeof(*ohci_data), dev);
if (!ohci) {
dev_err(dev, "omap_usbhs_alloc_child failed\n");
+ ret = -ENOMEM;
goto err_ehci;
}
return 0;
err_ehci:
- platform_device_put(ehci);
+ platform_device_unregister(ehci);
err_end:
return ret;