]> err.no Git - linux-2.6/commitdiff
PM: Do not check parent state in suspend and resume core code
authorRafael J. Wysocki <rjw@sisk.pl>
Sun, 17 Jun 2007 17:50:51 +0000 (19:50 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 11 Jul 2007 23:09:02 +0000 (16:09 -0700)
The checks if the device's parent is in the right state done in
drivers/base/power/suspend.c and drivers/base/power/resume.c serve no particular
purpose, since if the parent is in a wrong power state, the device's suspend or
resume callbacks are supposed to return an error anyway.  Moreover, they are
also useless from the sanity checking point of view, because they rely on the
code being checked to set dev->parent->power.power_state.event appropriately,
which need not happen if that code is buggy.  For these reasons they can be
removed.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/power/resume.c
drivers/base/power/suspend.c

index 0c961068854268d384c2da354c7e12daafaaaff9..00fd84ae6e66f955855f39286b66632c50b0e3dc 100644 (file)
@@ -29,13 +29,6 @@ int resume_device(struct device * dev)
 
        down(&dev->sem);
 
-       if (dev->parent && dev->parent->power.power_state.event) {
-               dev_err(dev, "PM: resume from %d, parent %s still %d\n",
-                       dev->power.power_state.event,
-                       dev->parent->bus_id,
-                       dev->parent->power.power_state.event);
-       }
-
        if (dev->bus && dev->bus->resume) {
                dev_dbg(dev,"resuming\n");
                error = dev->bus->resume(dev);
index a3ff3944832a863cfacd74c9c1125256f7b1fedd..26df9b231737de51c0541567553704cac4381d70 100644 (file)
@@ -63,13 +63,6 @@ int suspend_device(struct device * dev, pm_message_t state)
                dev_dbg(dev, "PM: suspend %d-->%d\n",
                        dev->power.power_state.event, state.event);
        }
-       if (dev->parent && dev->parent->power.power_state.event) {
-               dev_err(dev,
-                       "PM: suspend %d->%d, parent %s already %d\n",
-                       dev->power.power_state.event, state.event,
-                       dev->parent->bus_id,
-                       dev->parent->power.power_state.event);
-       }
 
        if (dev->class && dev->class->suspend) {
                suspend_device_dbg(dev, state, "class ");