diff mbox

[v1] mfd: Fix omap_usbhs_alloc_children error handling

Message ID 1305548647-19849-1-git-send-email-keshava_mgowda@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Munegowda, Keshava May 16, 2011, 12:24 p.m. UTC
From: Axel Lin <axel.lin@gmail.com>

rebased on top of hwmod and runtime pm patch series of usbhs

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Tested-by: Keshava Munegowda <keshava_mgowda@ti.com>
---
 drivers/mfd/omap-usb-host.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Comments

Felipe Balbi May 16, 2011, 12:29 p.m. UTC | #1
On Mon, May 16, 2011 at 05:54:07PM +0530, Keshava Munegowda wrote:
> From: Axel Lin <axel.lin@gmail.com>
> 
> rebased on top of hwmod and runtime pm patch series of usbhs
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> Tested-by: Keshava Munegowda <keshava_mgowda@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

> ---
>  drivers/mfd/omap-usb-host.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
> index e1bc3b5..32d19e2 100644
> --- a/drivers/mfd/omap-usb-host.c
> +++ b/drivers/mfd/omap-usb-host.c
> @@ -282,6 +282,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;
>  	}
>  
> @@ -305,13 +306,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;
> -- 
> 1.6.0.4
>
diff mbox

Patch

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index e1bc3b5..32d19e2 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -282,6 +282,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;
 	}
 
@@ -305,13 +306,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;