diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2021-03-05 10:00:01 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-05-25 07:51:29 +0200 |
commit | 5a8cc197456fe3d7a15c672b9bd46f49d3b934dc (patch) | |
tree | c324b67882b3ae9accabbedeb7bba52470087037 /drivers/usb | |
parent | 8e2ee4b2cd5bc372a00c11805b4fbfe7274a8fb4 (diff) | |
download | barebox-5a8cc197456fe3d7a15c672b9bd46f49d3b934dc.tar.gz barebox-5a8cc197456fe3d7a15c672b9bd46f49d3b934dc.tar.xz |
usb: i.MX: warn if vbus regulator isn't available
Instead of just ignoring errors related to getting the vbus regulator
yield at least a warning message. This would have saved me some
debugging time when trying to understand why USB doesn't work without
the right regulator driver enabled.
Note that machines that don't define a regulator in their device tree
don't issue this warning as regulator_get() returns the dummy regulator
in this case.
The alternative to error out wasn't accepted because this probably
creates regressions for regulators that are default-on but without a
driver in barebox.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.barebox.org/20210305090001.3619780-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/imx/chipidea-imx.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c index 7b87f302a9..aa27941c8c 100644 --- a/drivers/usb/imx/chipidea-imx.c +++ b/drivers/usb/imx/chipidea-imx.c @@ -256,8 +256,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)) { + dev_warn(dev, "Cannot get vbus regulator: %pe (ignoring)\n", + ci->vbus); ci->vbus = NULL; + } /* * Some devices have more than one clock, in this case they are enabled |