From: Rafael J. Wysocki Date: Fri, 3 Dec 2010 22:14:26 +0000 (+0100) Subject: PM: Use pm_wakeup_pending() in __device_suspend() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d83f905e126f8cbc5e4addc5d1a64aea785b732e;p=linux-beck.git 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 --- 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) 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 ");