From 5a8cc197456fe3d7a15c672b9bd46f49d3b934dc Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Fri, 5 Mar 2021 10:00:01 +0100 Subject: usb: i.MX: warn if vbus regulator isn't available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Link: https://lore.barebox.org/20210305090001.3619780-1-u.kleine-koenig@pengutronix.de Signed-off-by: Sascha Hauer --- drivers/usb/imx/chipidea-imx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/usb') 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 -- cgit v1.2.3