]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/host/u132-hcd.c
usb host: fix platform driver hotplug/coldplug
[linux-2.6-omap-h63xx.git] / drivers / usb / host / u132-hcd.c
index ac283b09a63f873c7d362f0305bdc957617a66c8..8e117a795e93768a878bab49c805b4a5410a77e8 100644 (file)
@@ -3213,15 +3213,20 @@ static int u132_suspend(struct platform_device *pdev, pm_message_t state)
                 dev_err(&u132->platform_dev->dev, "device is being removed\n");
                 return -ESHUTDOWN;
         } else {
-                int retval = 0;
-                if (state.event == PM_EVENT_FREEZE) {
+               int retval = 0, ports;
+
+               switch (state.event) {
+               case PM_EVENT_FREEZE:
                         retval = u132_bus_suspend(hcd);
-                } else if (state.event == PM_EVENT_SUSPEND) {
-                        int ports = MAX_U132_PORTS;
+                       break;
+               case PM_EVENT_SUSPEND:
+               case PM_EVENT_HIBERNATE:
+                       ports = MAX_U132_PORTS;
                         while (ports-- > 0) {
                                 port_power(u132, ports, 0);
                         }
-                }
+                       break;
+               }
                 if (retval == 0)
                         pdev->dev.power.power_state = state;
                 return retval;
@@ -3311,3 +3316,4 @@ static void __exit u132_hcd_exit(void)
 
 module_exit(u132_hcd_exit);
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:u132_hcd");