|
@@ -1011,10 +1011,7 @@ static int register_root_hub(struct usb_hcd *hcd)
|
|
|
if (retval) {
|
|
|
dev_err (parent_dev, "can't register root hub for %s, %d\n",
|
|
|
dev_name(&usb_dev->dev), retval);
|
|
|
- }
|
|
|
- mutex_unlock(&usb_bus_list_lock);
|
|
|
-
|
|
|
- if (retval == 0) {
|
|
|
+ } else {
|
|
|
spin_lock_irq (&hcd_root_hub_lock);
|
|
|
hcd->rh_registered = 1;
|
|
|
spin_unlock_irq (&hcd_root_hub_lock);
|
|
@@ -1023,6 +1020,7 @@ static int register_root_hub(struct usb_hcd *hcd)
|
|
|
if (HCD_DEAD(hcd))
|
|
|
usb_hc_died (hcd); /* This time clean up */
|
|
|
}
|
|
|
+ mutex_unlock(&usb_bus_list_lock);
|
|
|
|
|
|
return retval;
|
|
|
}
|