Merge branch 'x86-uaccess-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[deliverable/linux.git] / drivers / usb / chipidea / host.c
index 6f96795dd20cc3ff3d0c08490ae8d87b0b2ccccf..59e6020ea7539e5e331364ac067c9a16f27855ba 100644 (file)
@@ -100,16 +100,18 @@ static void host_stop(struct ci_hdrc *ci)
 {
        struct usb_hcd *hcd = ci->hcd;
 
-       usb_remove_hcd(hcd);
-       usb_put_hcd(hcd);
-       if (ci->platdata->reg_vbus)
-               regulator_disable(ci->platdata->reg_vbus);
+       if (hcd) {
+               usb_remove_hcd(hcd);
+               usb_put_hcd(hcd);
+               if (ci->platdata->reg_vbus)
+                       regulator_disable(ci->platdata->reg_vbus);
+       }
 }
 
 
 void ci_hdrc_host_destroy(struct ci_hdrc *ci)
 {
-       if (ci->role == CI_ROLE_HOST)
+       if (ci->role == CI_ROLE_HOST && ci->hcd)
                host_stop(ci);
 }
 
This page took 0.024559 seconds and 5 git commands to generate.