Commit d910774f authored by Axel Lin's avatar Axel Lin Committed by Samuel Ortiz

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: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Tested-by: default avatarKeshava Munegowda <keshava_mgowda@ti.com>
Acked-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 6eb6fbbf
...@@ -281,6 +281,7 @@ static int omap_usbhs_alloc_children(struct platform_device *pdev) ...@@ -281,6 +281,7 @@ static int omap_usbhs_alloc_children(struct platform_device *pdev)
if (!ehci) { if (!ehci) {
dev_err(dev, "omap_usbhs_alloc_child failed\n"); dev_err(dev, "omap_usbhs_alloc_child failed\n");
ret = -ENOMEM;
goto err_end; goto err_end;
} }
...@@ -304,13 +305,14 @@ static int omap_usbhs_alloc_children(struct platform_device *pdev) ...@@ -304,13 +305,14 @@ static int omap_usbhs_alloc_children(struct platform_device *pdev)
sizeof(*ohci_data), dev); sizeof(*ohci_data), dev);
if (!ohci) { if (!ohci) {
dev_err(dev, "omap_usbhs_alloc_child failed\n"); dev_err(dev, "omap_usbhs_alloc_child failed\n");
ret = -ENOMEM;
goto err_ehci; goto err_ehci;
} }
return 0; return 0;
err_ehci: err_ehci:
platform_device_put(ehci); platform_device_unregister(ehci);
err_end: err_end:
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment