]> Git Repo - linux.git/blobdiff - drivers/usb/dwc2/platform.c
drm/nouveau/kms: Don't change EDID when it hasn't actually changed
[linux.git] / drivers / usb / dwc2 / platform.c
index cb8ddbd537187de004e2acc1a0f2885debb667ef..db9fd4bd1a38cd9647401e8961d6e0bb3650d96c 100644 (file)
@@ -582,6 +582,7 @@ static int dwc2_driver_probe(struct platform_device *dev)
        if (hsotg->gadget_enabled) {
                retval = usb_add_gadget_udc(hsotg->dev, &hsotg->gadget);
                if (retval) {
+                       hsotg->gadget.udc = NULL;
                        dwc2_hsotg_remove(hsotg);
                        goto error_init;
                }
@@ -593,7 +594,8 @@ error_init:
        if (hsotg->params.activate_stm_id_vb_detection)
                regulator_disable(hsotg->usb33d);
 error:
-       dwc2_lowlevel_hw_disable(hsotg);
+       if (hsotg->dr_mode != USB_DR_MODE_PERIPHERAL)
+               dwc2_lowlevel_hw_disable(hsotg);
        return retval;
 }
 
This page took 0.032601 seconds and 4 git commands to generate.