mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] usb: chipidea-imx: check return value of regulator_get()
@ 2016-01-07  9:55 Lucas Stach
  2016-01-08  7:52 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Lucas Stach @ 2016-01-07  9:55 UTC (permalink / raw)
  To: barebox

From: David Jander <david@protonic.nl>

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>
---
lst: reworded commit message
---
 drivers/usb/imx/chipidea-imx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
index ae307183bc1f..a1c36cf6445d 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))
-- 
2.6.4


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

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

* Re: [PATCH] usb: chipidea-imx: check return value of regulator_get()
  2016-01-07  9:55 [PATCH] usb: chipidea-imx: check return value of regulator_get() Lucas Stach
@ 2016-01-08  7:52 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2016-01-08  7:52 UTC (permalink / raw)
  To: Lucas Stach; +Cc: barebox

On Thu, Jan 07, 2016 at 10:55:00AM +0100, Lucas Stach wrote:
> From: David Jander <david@protonic.nl>
> 
> 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>
> ---
> lst: reworded commit message
> ---
>  drivers/usb/imx/chipidea-imx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 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

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

end of thread, other threads:[~2016-01-08  7:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-07  9:55 [PATCH] usb: chipidea-imx: check return value of regulator_get() Lucas Stach
2016-01-08  7:52 ` Sascha Hauer

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