[PATCH] USB Storage: make OneTouch PM-aware
[firefly-linux-kernel-4.4.55.git] / drivers / usb / storage / usb.c
index 484ed297bed098824d0617525976bf421ede50b4..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"};