From: Kalle Jokiniemi <kalle.jokiniemi@jollamobile.com>
To: Fabio Baltieri <fabio.baltieri@linaro.org>
Cc: Felipe Balbi <balbi@ti.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH 2/3] usb: phy: twl4030-usb: check regulator_enable return value
Date: Wed, 03 Apr 2013 18:12:47 +0300 [thread overview]
Message-ID: <1365001967.3294.4.camel@X230> (raw)
In-Reply-To: <1364997747-20830-3-git-send-email-fabio.baltieri@linaro.org>
On Wed, 2013-04-03 at 16:02 +0200, Fabio Baltieri wrote:
> Since regulator_enable() is going to be marked as __must_check in the
> next merge window, always check regulator_enable() return value and
> print a warning if it fails.
Could go bananas with this and all kinds of recovery schemes, but nah..
Looks good to me. FWIW,
Reviewed-by: Kalle Jokiniemi <kalle.jokiniemi@jollamobile.com>
>
> Cc: Kalle Jokiniemi <kalle.jokiniemi@jollamobile.com>
> Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
> ---
> drivers/usb/phy/phy-twl4030-usb.c | 18 +++++++++++++++---
> 1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/phy/phy-twl4030-usb.c b/drivers/usb/phy/phy-twl4030-usb.c
> index 3f9858f..13e17ae 100644
> --- a/drivers/usb/phy/phy-twl4030-usb.c
> +++ b/drivers/usb/phy/phy-twl4030-usb.c
> @@ -384,9 +384,17 @@ static void __twl4030_phy_power(struct twl4030_usb *twl, int on)
>
> static void twl4030_phy_power(struct twl4030_usb *twl, int on)
> {
> + int ret;
> +
> if (on) {
> - regulator_enable(twl->usb3v1);
> - regulator_enable(twl->usb1v8);
> + ret = regulator_enable(twl->usb3v1);
> + if (ret)
> + dev_err(twl->dev, "Failed to enable usb3v1\n");
> +
> + ret = regulator_enable(twl->usb1v8);
> + if (ret)
> + dev_err(twl->dev, "Failed to enable usb1v8\n");
> +
> /*
> * Disabling usb3v1 regulator (= writing 0 to VUSB3V1_DEV_GRP
> * in twl4030) resets the VUSB_DEDICATED2 register. This reset
> @@ -395,7 +403,11 @@ static void twl4030_phy_power(struct twl4030_usb *twl, int on)
> * is re-activated. This ensures that VUSB3V1 is really active.
> */
> twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2);
> - regulator_enable(twl->usb1v5);
> +
> + ret = regulator_enable(twl->usb1v5);
> + if (ret)
> + dev_err(twl->dev, "Failed to enable usb1v5\n");
> +
> __twl4030_phy_power(twl, 1);
> twl4030_usb_write(twl, PHY_CLK_CTRL,
> twl4030_usb_read(twl, PHY_CLK_CTRL) |
next prev parent reply other threads:[~2013-04-03 15:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-03 14:02 [PATCH 0/3] check regulator_enable() return value Fabio Baltieri
2013-04-03 14:02 ` [PATCH 1/3] usb: phy: ab8500-usb: check regulator_enable " Fabio Baltieri
2013-04-03 14:02 ` [PATCH 2/3] usb: phy: twl4030-usb: " Fabio Baltieri
2013-04-03 15:12 ` Kalle Jokiniemi [this message]
2013-04-03 14:02 ` [PATCH 3/3] usb: phy: twl6030-usb: " Fabio Baltieri
2013-04-03 14:06 ` [PATCH 0/3] check regulator_enable() " Felipe Balbi
2013-04-03 14:12 ` Fabio Baltieri
2013-04-03 14:22 ` Greg KH
2013-04-03 15:44 ` Felipe Balbi
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=1365001967.3294.4.camel@X230 \
--to=kalle.jokiniemi@jollamobile.com \
--cc=balbi@ti.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=fabio.baltieri@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.