mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] usb: i.MX: improve regulator handling
Date: Tue, 20 Oct 2020 15:33:17 +0200	[thread overview]
Message-ID: <20201020133317.dc6yt2yt4tyk5ogm@pengutronix.de> (raw)
In-Reply-To: <20201020111537.29328-1-u.kleine-koenig@pengutronix.de>

Hi Uwe,

On 20-10-20 13:15, Uwe Kleine-König wrote:
> Instead of just ignoring errors related to regulator getting error out.
> In case there is no regulator in the device tree, regulator_get() returns
> the dummy regulator and not an error code, so the change is right for
> this situation, too.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/usb/imx/chipidea-imx.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
> index 786beede6d89..dd0e3c1a2a58 100644
> --- a/drivers/usb/imx/chipidea-imx.c
> +++ b/drivers/usb/imx/chipidea-imx.c
> @@ -267,8 +267,11 @@ static int imx_chipidea_probe(struct device_d *dev)
>  	}
>  
>  	ci->vbus = regulator_get(dev, "vbus");
> -	if (IS_ERR(ci->vbus))
> -		ci->vbus = NULL;
> +	if (IS_ERR(ci->vbus)) {
> +		ret = ERR_PTR(ci->vbus);
> +		dev_err(dev, "Cannot get vbus regulator: %s\n", strerror(-ret));
> +		return ret;

Returning the error here can cause problems with exisiting boards, e.g.
if the regulator support is missing for the specified vbus regulator.
This is often the case since we have very limited regulator support for
now.

Regards,
  Marco

> +	}

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2020-10-20 13:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-20 11:15 Uwe Kleine-König
2020-10-20 13:33 ` Marco Felsch [this message]
2020-10-20 14:09   ` Sascha Hauer
2020-10-20 14:28     ` Marco Felsch
2020-10-20 14:58       ` Marco Felsch
2020-10-21  5:49         ` Uwe Kleine-König
2020-10-21  6:07           ` Sascha Hauer
2020-10-21 14:29           ` Marco Felsch
2020-10-21 15:28             ` Marco Felsch
2020-10-21 19:05               ` Uwe Kleine-König
2020-10-21 10:05 ` Sascha Hauer
2020-10-21 12:03   ` Uwe Kleine-König
2020-10-21 12:31     ` Sascha Hauer

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=20201020133317.dc6yt2yt4tyk5ogm@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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