]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
PM: Remove prev_state from struct dev_pm_info
authorRafael J. Wysocki <rjw@sisk.pl>
Sun, 17 Jun 2007 17:48:06 +0000 (19:48 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 11 Jul 2007 23:09:02 +0000 (16:09 -0700)
The prev_state member of struct dev_pm_info (defined in include/linux/pm.h) is
only used during a resume to check if the device's state before the suspend was
'off', in which case the device is not resumed.  However, in such cases the
decision whether or not to resume the device should be made on the driver level
and the resume callbacks from the device's bus and class should be executed
anyway (the may be needed for some things other than just powering on the
device).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/power/resume.c
drivers/base/power/suspend.c
drivers/usb/core/hub.c
include/linux/pm.h

index 99679e7a6cc625a8ff8158b47972e7b16080ee30..0c961068854268d384c2da354c7e12daafaaaff9 100644 (file)
@@ -88,8 +88,7 @@ void dpm_resume(void)
                list_move_tail(entry, &dpm_active);
 
                mutex_unlock(&dpm_list_mtx);
-               if (!dev->power.prev_state.event)
-                       resume_device(dev);
+               resume_device(dev);
                mutex_lock(&dpm_list_mtx);
                put_device(dev);
        }
index af2cedfbc1b437831e54622c68b0152e5de848dd..5178b0fbd82ee489a6cfca9567fda3b1dd62c6bf 100644 (file)
@@ -71,8 +71,6 @@ int suspend_device(struct device * dev, pm_message_t state)
                        dev->parent->power.power_state.event);
        }
 
-       dev->power.prev_state = dev->power.power_state;
-
        if (dev->class && dev->class->suspend && !dev->power.power_state.event) {
                suspend_device_dbg(dev, state, "class ");
                error = dev->class->suspend(dev, state);
index 24f10a19dbdbc1bbbf6befd31da7018078cfa186..a9cf8b30bccc0f55364310df5dc8d3a97372fab0 100644 (file)
@@ -1109,11 +1109,6 @@ void usb_root_hub_lost_power(struct usb_device *rhdev)
 
        dev_warn(&rhdev->dev, "root hub lost power or was reset\n");
 
-       /* Make sure no potential wakeup events get lost,
-        * by forcing the root hub to be resumed.
-        */
-       rhdev->dev.power.prev_state.event = PM_EVENT_ON;
-
        spin_lock_irqsave(&device_state_lock, flags);
        hub = hdev_to_hub(rhdev);
        for (port1 = 1; port1 <= rhdev->maxchild; ++port1) {
index 6e7f066716839b5692e10d7014f9381fa4018d3b..273781c82e4dd1551ad41b4550b6bb1dcda1f4a1 100644 (file)
@@ -267,7 +267,6 @@ struct dev_pm_info {
        unsigned                can_wakeup:1;
 #ifdef CONFIG_PM
        unsigned                should_wakeup:1;
-       pm_message_t            prev_state;
        struct list_head        entry;
 #endif
 };