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 <[email protected]>
Signed-off-by: Axel Lin <[email protected]>
Tested-by: Keshava Munegowda <[email protected]>
Acked-by: Felipe Balbi <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
if (!ehci) {
dev_err(dev, "omap_usbhs_alloc_child failed\n");
+ ret = -ENOMEM;
goto err_end;
}
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;