Merge branch 'x86-uaccess-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[deliverable/linux.git] / drivers / usb / chipidea / host.c
index 64d7a6d9a1adcbd679258661a6b5875bd8bf834a..59e6020ea7539e5e331364ac067c9a16f27855ba 100644 (file)
@@ -103,15 +103,15 @@ static void host_stop(struct ci_hdrc *ci)
        if (hcd) {
                usb_remove_hcd(hcd);
                usb_put_hcd(hcd);
+               if (ci->platdata->reg_vbus)
+                       regulator_disable(ci->platdata->reg_vbus);
        }
-       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.024821 seconds and 5 git commands to generate.