From: Hein Tibosch <hein_tibosch@yahoo.es>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org,
Mike Rapoport <mike@compulab.co.il>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
Chris Ball <cjb@laptop.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: pxa: propagate errors from regulator_enable() to pxamci
Date: Tue, 09 Jul 2013 01:42:57 +0800 [thread overview]
Message-ID: <51DAFA21.8060708@yahoo.es> (raw)
In-Reply-To: <201307051751.20729.arnd@arndb.de>
Hi Arnd,
On 7/5/2013 11:51 PM, 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 <arnd@arndb.de>
> Cc: Mike Rapoport <mike@compulab.co.il>
> Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
> Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
> Cc: Chris Ball <cjb@laptop.org>
>
> 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;
> +
> + err = regulator_enable(em_x270_usb_ldo);
Didn't you mean the other way around:
regulator_disable(em_x270_usb_ldo);
- regulator_enable(em_x270_usb_ldo);
+ err = regulator_enable(em_x270_usb_ldo);
+ if (err)
+ goto err_free_rst_gpio;
+
?
Hein
> 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;
> }
> <snip>
prev parent reply other threads:[~2013-07-08 18:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-05 15:51 [PATCH] ARM: pxa: propagate errors from regulator_enable() to pxamci Arnd Bergmann
2013-07-05 15:53 ` Chris Ball
2013-07-23 19:15 ` Olof Johansson
2013-07-08 4:35 ` Sachin Kamat
2013-07-08 17:42 ` Hein Tibosch [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51DAFA21.8060708@yahoo.es \
--to=hein_tibosch@yahoo.es \
--cc=arnd@arndb.de \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=cjb@laptop.org \
--cc=haojian.zhuang@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=mike@compulab.co.il \
--cc=paul.gortmaker@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox