diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2010-12-03 17:14:26 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2010-12-24 09:02:42 -0500 |
commit | d83f905e126f8cbc5e4addc5d1a64aea785b732e (patch) | |
tree | 45778fff5807b9e844f5290d4f0674433d157102 /drivers/base/power/main.c | |
parent | a2867e08c8e3bdbc00caf56bc3bdde19ccc058e3 (diff) |
PM: Use pm_wakeup_pending() in __device_suspend()
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>
Diffstat (limited to 'drivers/base/power/main.c')
-rw-r--r-- | drivers/base/power/main.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 8a5258339ca2..fb4ca2870081 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
@@ -877,6 +877,11 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async) | |||
877 | if (async_error) | 877 | if (async_error) |
878 | goto End; | 878 | goto End; |
879 | 879 | ||
880 | if (pm_wakeup_pending()) { | ||
881 | async_error = -EBUSY; | ||
882 | goto End; | ||
883 | } | ||
884 | |||
880 | if (dev->class) { | 885 | if (dev->class) { |
881 | if (dev->class->pm) { | 886 | if (dev->class->pm) { |
882 | pm_dev_dbg(dev, state, "class "); | 887 | pm_dev_dbg(dev, state, "class "); |