summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Jander <david@protonic.nl>2016-01-07 10:55:00 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-01-08 08:52:02 +0100
commit0295088d53cd605aaf2a2accfd65c19c0f8a0cf0 (patch)
tree47c76453711f8897ee4b38f745f5848890a666e5
parentf1da98da2760c21487bbba8f7fb957c843a22896 (diff)
downloadbarebox-0295088d53cd605aaf2a2accfd65c19c0f8a0cf0.tar.gz
usb: chipidea-imx: check return value of regulator_get()
The VBUS regulator is optional for the chipidea-imx glue, so it must be checked if regulator_get provided a valid regulator handle before trying to enable the regulator. Signed-off-by: David Jander <david@protonic.nl> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/usb/imx/chipidea-imx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
index ae30718..a1c36cf 100644
--- a/drivers/usb/imx/chipidea-imx.c
+++ b/drivers/usb/imx/chipidea-imx.c
@@ -242,7 +242,8 @@ static int imx_chipidea_probe(struct device_d *dev)
ci->vbus = regulator_get(dev, "vbus");
- regulator_enable(ci->vbus);
+ if (!IS_ERR(ci->vbus))
+ regulator_enable(ci->vbus);
base = dev_request_mem_region(dev, 0);
if (IS_ERR(base))