Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753491Ab3GHEfu (ORCPT ); Mon, 8 Jul 2013 00:35:50 -0400 Received: from mail-oa0-f45.google.com ([209.85.219.45]:64757 "EHLO mail-oa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750932Ab3GHEft (ORCPT ); Mon, 8 Jul 2013 00:35:49 -0400 MIME-Version: 1.0 In-Reply-To: <201307051751.20729.arnd@arndb.de> References: <201307051751.20729.arnd@arndb.de> Date: Mon, 8 Jul 2013 10:05:48 +0530 Message-ID: Subject: Re: [PATCH] ARM: pxa: propagate errors from regulator_enable() to pxamci From: Sachin Kamat To: Arnd Bergmann Cc: linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, Mike Rapoport , Paul Gortmaker , Mark Brown , Haojian Zhuang , Chris Ball , linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2237 Lines: 63 On 5 July 2013 21:21, Arnd Bergmann wrote: > The em_x270_mci_setpower() and em_x270_usb_hub_init() functions > call regulator_enable(), which may return an error that must > be checked. > > This changes the em_x270_usb_hub_init() function to bail out > if it fails, and changes the pxamci_platform_data->setpower > callback so that the a failed em_x270_mci_setpower call > can be propagated by the pxamci driver into the mmc core. > > Signed-off-by: Arnd Bergmann > Cc: Mike Rapoport > Cc: Paul Gortmaker > Cc: Mark Brown > Cc: Haojian Zhuang > Cc: Chris Ball > > diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c > index f6726bb..f8062e4 100644 > --- a/arch/arm/mach-pxa/em-x270.c > +++ b/arch/arm/mach-pxa/em-x270.c > @@ -477,16 +477,24 @@ static int em_x270_usb_hub_init(void) > /* USB Hub power-on and reset */ > gpio_direction_output(usb_hub_reset, 1); > gpio_direction_output(GPIO9_USB_VBUS_EN, 0); > - regulator_enable(em_x270_usb_ldo); > + err = regulator_enable(em_x270_usb_ldo); > + if (err) > + goto err_free_rst_gpio; > + > gpio_set_value(usb_hub_reset, 0); > gpio_set_value(usb_hub_reset, 1); > regulator_disable(em_x270_usb_ldo); > - regulator_enable(em_x270_usb_ldo); > + if (err) > + goto err_free_rst_gpio; Shouldn't this check be after the below (regulator_enable) statement? > + > + err = regulator_enable(em_x270_usb_ldo); > gpio_set_value(usb_hub_reset, 0); > gpio_set_value(GPIO9_USB_VBUS_EN, 1); > > return 0; > > +err_free_rst_gpio: > + gpio_free(usb_hub_reset); > err_free_vbus_gpio: > gpio_free(GPIO9_USB_VBUS_EN); > err_free_usb_ldo: > @@ -592,7 +600,7 @@ err_irq: > return err; > } -- With warm regards, Sachin -- 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/