Merge branch 'pm-runtime' into pm-for-linus
authorRafael J. Wysocki <rjw@sisk.pl>
Sun, 25 Dec 2011 22:43:05 +0000 (23:43 +0100)
committerRafael J. Wysocki <rjw@sisk.pl>
Sun, 25 Dec 2011 22:43:05 +0000 (23:43 +0100)
* pm-runtime:
  PM / Runtime: Use device PM QoS constraints (v2)

1  2 
drivers/base/power/runtime.c
include/linux/pm.h

@@@ -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);
Simple merge