提交 d910774f 编写于 作者: A Axel Lin 提交者: 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: NAxel Lin <axel.lin@gmail.com>
Signed-off-by: NAxel Lin <axel.lin@gmail.com>
Tested-by: NKeshava Munegowda <keshava_mgowda@ti.com>
Acked-by: NFelipe Balbi <balbi@ti.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 6eb6fbbf
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册