Skip to content

Commit

Permalink
PM: Use pm_wakeup_pending() in __device_suspend()
Browse files Browse the repository at this point in the history
Before starting to suspend a device in __device_suspend() check if
there's a request to abort the power transition and return -EBUSY
in that case.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
  • Loading branch information
Rafael J. Wysocki committed Dec 24, 2010
1 parent a2867e0 commit d83f905
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/base/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,11 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
if (async_error)
goto End;

if (pm_wakeup_pending()) {
async_error = -EBUSY;
goto End;
}

if (dev->class) {
if (dev->class->pm) {
pm_dev_dbg(dev, state, "class ");
Expand Down

0 comments on commit d83f905

Please sign in to comment.