mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	barebox@lists.infradead.org
Cc: Marco Felsch <m.felsch@pengutronix.de>
Subject: Re: [PATCH] usb: i.MX: warn if vbus regulator isn't available
Date: Tue, 27 Oct 2020 18:57:58 +0100	[thread overview]
Message-ID: <1485d35a-d55b-2440-4852-1737e78f8aa1@pengutronix.de> (raw)
In-Reply-To: <20201027174025.23228-1-u.kleine-koenig@pengutronix.de>

Hello Uwe,

On 10/27/20 6:40 PM, Uwe Kleine-König wrote:
> Instead of just ignoring errors related to regulator yield at least a
> warning message.
> 
> In case there is no regulator in the device tree, regulator_get() returns
> the dummy regulator and not an error code. The alternative to error out
> wasn't accepted because this probably creates regressions for regulators
> that are default-on but without a driver.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/usb/imx/chipidea-imx.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
> index 786beede6d89..ad3eb9aa35aa 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))
> +	if (IS_ERR(ci->vbus)) {
> +		ret = ERR_PTR(ci->vbus);
> +		dev_warn(dev, "Cannot get vbus regulator: %s (ignoring)\n", strerror(-ret));

We have %pe now in barebox that you can use instead.

>  		ci->vbus = NULL;
> +	}
>  
>  	/*
>  	 * Some devices have more than one clock, in this case they are enabled
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

      reply	other threads:[~2020-10-27 17:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27 17:40 Uwe Kleine-König
2020-10-27 17:57 ` Ahmad Fatoum [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=1485d35a-d55b-2440-4852-1737e78f8aa1@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=m.felsch@pengutronix.de \
    --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