Merge remote-tracking branch 'linux-2.6.32.y/master' into develop
[firefly-linux-kernel-4.4.55.git] / drivers / usb / core / hub.c
old mode 100644 (file)
new mode 100755 (executable)
index 283f019..8ff77b6
@@ -1189,7 +1189,7 @@ static void hub_disconnect(struct usb_interface *intf)
 
        kref_put(&hub->kref, hub_release);
 }
-
+struct usb_hub *g_root_hub20 = NULL;
 static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
 {
        struct usb_host_interface *desc;
@@ -1240,7 +1240,10 @@ descriptor_error:
                dev_dbg (&intf->dev, "couldn't kmalloc hub struct\n");
                return -ENOMEM;
        }
-
+       if(!g_root_hub20)
+       {
+               g_root_hub20 = hub;
+       }
        kref_init(&hub->kref);
        INIT_LIST_HEAD(&hub->event_list);
        hub->intfdev = &intf->dev;
@@ -1608,6 +1611,7 @@ void usb_disconnect(struct usb_device **pdev)
        spin_unlock_irq(&device_state_lock);
 
        usb_stop_pm(udev);
+    
 
        hub_free_dev(udev);
 
@@ -3412,6 +3416,14 @@ loop:
         } /* end while (1) */
 }
 
+/* yk@rk 20100730 
+ * disconnect all devices on root hub
+ */
+void hub_disconnect_device(struct usb_hub *hub)
+{
+       hub_port_connect_change(hub, 1, 0, 0x2);
+}
+
 static int hub_thread(void *__unused)
 {
        /* khubd needs to be freezable to avoid intefering with USB-PERSIST