Skip to content

Commit

Permalink
PM: Do not check parent state in suspend and resume core code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rafael J. Wysocki authored and Greg Kroah-Hartman committed Jul 11, 2007
1 parent 1c3f7d1 commit 43a49f8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
7 changes: 0 additions & 7 deletions drivers/base/power/resume.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 0 additions & 7 deletions drivers/base/power/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ");
Expand Down

0 comments on commit 43a49f8

Please sign in to comment.