[PATCH] USB Storage: make OneTouch PM-aware
[firefly-linux-kernel-4.4.55.git] / drivers / usb / storage / usb.c
index c8375aa627238a591a6968c40972db9e5bb8914c..ca02ae97be8643bfe43e11bfc552ce9b69a4ff95 100644 (file)
@@ -188,6 +188,8 @@ static int storage_suspend(struct usb_interface *iface, pm_message_t message)
        down(&us->dev_semaphore);
 
        US_DEBUGP("%s\n", __FUNCTION__);
+       if (us->suspend_resume_hook)
+               (us->suspend_resume_hook)(us, US_SUSPEND);
        iface->dev.power.power_state.event = message.event;
 
        /* When runtime PM is working, we'll set a flag to indicate
@@ -204,6 +206,8 @@ static int storage_resume(struct usb_interface *iface)
        down(&us->dev_semaphore);
 
        US_DEBUGP("%s\n", __FUNCTION__);
+       if (us->suspend_resume_hook)
+               (us->suspend_resume_hook)(us, US_RESUME);
        iface->dev.power.power_state.event = PM_EVENT_ON;
 
        up(&us->dev_semaphore);
@@ -470,7 +474,7 @@ static void get_device_info(struct us_data *us, const struct usb_device_id *id)
         * from the unusual_devs.h table.
         */
        if (id->idVendor || id->idProduct) {
-               static char *msgs[3] = {
+               static const char *msgs[3] = {
                        "an unneeded SubClass entry",
                        "an unneeded Protocol entry",
                        "unneeded SubClass and Protocol entries"};
@@ -1000,7 +1004,6 @@ static void storage_disconnect(struct usb_interface *intf)
  ***********************************************************************/
 
 static struct usb_driver usb_storage_driver = {
-       .owner =        THIS_MODULE,
        .name =         "usb-storage",
        .probe =        storage_probe,
        .disconnect =   storage_disconnect,