Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754875Ab1EPLEB (ORCPT ); Mon, 16 May 2011 07:04:01 -0400 Received: from na3sys009aog110.obsmtp.com ([74.125.149.203]:36168 "EHLO na3sys009aog110.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754400Ab1EPLEA convert rfc822-to-8bit (ORCPT ); Mon, 16 May 2011 07:04:00 -0400 MIME-Version: 1.0 In-Reply-To: <1305353736.11286.2.camel@phoenix> References: <1305353736.11286.2.camel@phoenix> Date: Mon, 16 May 2011 16:33:58 +0530 Message-ID: Subject: Re: [PATCH] mfd: Fix omap_usbhs_alloc_children error handling From: "Munegowda, Keshava" To: Axel Lin Cc: linux-kernel@vger.kernel.org, Felipe Balbi , Samuel Ortiz Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1735 Lines: 53 On Sat, May 14, 2011 at 11:45 AM, 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. > > Signed-off-by: Axel Lin > --- > ?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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/