diff options
author | Jiri Kosina <jkosina@suse.cz> | 2018-06-08 10:22:26 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2018-06-08 10:22:26 +0200 |
commit | 37acd687269f8cb8366598e292f96eb5605d3e3a (patch) | |
tree | e49cc91bef34755b9a279b60ed8d10ea01eec725 /drivers/usb/dwc2/hcd.c | |
parent | 79b83b05b07a40c67ac7196555d2b0293cdf26e7 (diff) | |
parent | 4b64487fa63a71bbed883b55268ea275da6f8a7a (diff) | |
download | linux-37acd687269f8cb8366598e292f96eb5605d3e3a.tar.bz2 |
Merge branch 'for-4.18/hid-steam' into for-linus
Valve Steam Controller support from Rodrigo Rivas Costa
Diffstat (limited to 'drivers/usb/dwc2/hcd.c')
-rw-r--r-- | drivers/usb/dwc2/hcd.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 190f95964000..c51b73b3e048 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -358,9 +358,14 @@ static void dwc2_gusbcfg_init(struct dwc2_hsotg *hsotg) static int dwc2_vbus_supply_init(struct dwc2_hsotg *hsotg) { + int ret; + hsotg->vbus_supply = devm_regulator_get_optional(hsotg->dev, "vbus"); - if (IS_ERR(hsotg->vbus_supply)) - return 0; + if (IS_ERR(hsotg->vbus_supply)) { + ret = PTR_ERR(hsotg->vbus_supply); + hsotg->vbus_supply = NULL; + return ret == -ENODEV ? 0 : ret; + } return regulator_enable(hsotg->vbus_supply); } @@ -4342,9 +4347,7 @@ static int _dwc2_hcd_start(struct usb_hcd *hcd) spin_unlock_irqrestore(&hsotg->lock, flags); - dwc2_vbus_supply_init(hsotg); - - return 0; + return dwc2_vbus_supply_init(hsotg); } /* |