mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] usb: i.MX: improve regulator handling
@ 2020-10-20 11:15 Uwe Kleine-König
  2020-10-20 13:33 ` Marco Felsch
  2020-10-21 10:05 ` Sascha Hauer
  0 siblings, 2 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2020-10-20 11:15 UTC (permalink / raw)
  To: barebox

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;
+	}
 
 	/*
 	 * Some devices have more than one clock, in this case they are enabled
-- 
2.28.0


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-10-21 19:05 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20 11:15 [PATCH] usb: i.MX: improve regulator handling Uwe Kleine-König
2020-10-20 13:33 ` Marco Felsch
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox