public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: Fix omap_usbhs_alloc_children error handling
@ 2011-05-14  6:15 Axel Lin
  2011-05-16 11:03 ` Munegowda, Keshava
  2011-05-22 19:09 ` Samuel Ortiz
  0 siblings, 2 replies; 4+ messages in thread
From: Axel Lin @ 2011-05-14  6:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: Keshava Munegowda, Felipe Balbi, Samuel Ortiz

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>
---
 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 3ab9ffa..344f518 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;
-- 
1.7.1




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mfd: Fix omap_usbhs_alloc_children error handling
  2011-05-14  6:15 [PATCH] mfd: Fix omap_usbhs_alloc_children error handling Axel Lin
@ 2011-05-16 11:03 ` Munegowda, Keshava
  2011-05-16 11:12   ` Felipe Balbi
  2011-05-22 19:09 ` Samuel Ortiz
  1 sibling, 1 reply; 4+ messages in thread
From: Munegowda, Keshava @ 2011-05-16 11:03 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Felipe Balbi, Samuel Ortiz

On Sat, May 14, 2011 at 11:45 AM, Axel Lin <axel.lin@gmail.com> wrote:
> 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>
> ---
>  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 3ab9ffa..344f518 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;
> --
> 1.7.1
>

Looks goo to me;

Balbi,
      I will take this patch on top of hwmod and runtime pm patches?
is it OK for you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mfd: Fix omap_usbhs_alloc_children error handling
  2011-05-16 11:03 ` Munegowda, Keshava
@ 2011-05-16 11:12   ` Felipe Balbi
  0 siblings, 0 replies; 4+ messages in thread
From: Felipe Balbi @ 2011-05-16 11:12 UTC (permalink / raw)
  To: Munegowda, Keshava; +Cc: Axel Lin, linux-kernel, Felipe Balbi, Samuel Ortiz

[-- Attachment #1: Type: text/plain, Size: 1839 bytes --]

Hi,

On Mon, May 16, 2011 at 04:33:58PM +0530, Munegowda, Keshava wrote:
> On Sat, May 14, 2011 at 11:45 AM, Axel Lin <axel.lin@gmail.com> wrote:
> > 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>
> > ---
> >  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 3ab9ffa..344f518 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;
> > --
> > 1.7.1
> >
> 
> Looks goo to me;
> 
> Balbi,
>       I will take this patch on top of hwmod and runtime pm patches?
> is it OK for you.

It's ok. Just be sure to split the series correctly:

arch/arm/*omap*/ -> to Tony
drivers/mfd/* -> to Samuel

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mfd: Fix omap_usbhs_alloc_children error handling
  2011-05-14  6:15 [PATCH] mfd: Fix omap_usbhs_alloc_children error handling Axel Lin
  2011-05-16 11:03 ` Munegowda, Keshava
@ 2011-05-22 19:09 ` Samuel Ortiz
  1 sibling, 0 replies; 4+ messages in thread
From: Samuel Ortiz @ 2011-05-22 19:09 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Keshava Munegowda, Felipe Balbi

Hi Axel,

On Sat, May 14, 2011 at 02:15:36PM +0800, Axel Lin wrote:
> 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.
Patch applied, thanks a lot.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-22 19:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-14  6:15 [PATCH] mfd: Fix omap_usbhs_alloc_children error handling Axel Lin
2011-05-16 11:03 ` Munegowda, Keshava
2011-05-16 11:12   ` Felipe Balbi
2011-05-22 19:09 ` Samuel Ortiz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox