From: Rafael J. Wysocki Date: Sun, 25 Dec 2011 22:43:05 +0000 (+0100) Subject: Merge branch 'pm-runtime' into pm-for-linus X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0015afaa1f818d38ea9f8e81a84a6aeeca5fdaf0;p=linux.git Merge branch 'pm-runtime' into pm-for-linus * pm-runtime: PM / Runtime: Use device PM QoS constraints (v2) --- 0015afaa1f818d38ea9f8e81a84a6aeeca5fdaf0 diff --cc drivers/base/power/runtime.c index c56efd756531f,068f7ed1f009f..541f821d4ea68 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@@ -416,31 -485,10 +488,13 @@@ static int rpm_suspend(struct device *d else callback = NULL; + if (!callback && dev->driver && dev->driver->pm) + callback = dev->driver->pm->runtime_suspend; + retval = rpm_callback(callback, dev); - if (retval) { - __update_runtime_status(dev, RPM_ACTIVE); - dev->power.deferred_resume = false; - if (retval == -EAGAIN || retval == -EBUSY) { - dev->power.runtime_error = 0; + if (retval) + goto fail; - /* - * If the callback routine failed an autosuspend, and - * if the last_busy time has been updated so that there - * is a new autosuspend expiration time, automatically - * reschedule another autosuspend. - */ - if ((rpmflags & RPM_AUTO) && - pm_runtime_autosuspend_expiration(dev) != 0) - goto repeat; - } else { - pm_runtime_cancel_pending(dev); - } - wake_up_all(&dev->power.wait_queue); - goto out; - } no_callback: __update_runtime_status(dev, RPM_SUSPENDED); pm_runtime_deactivate_timer(dev);