Skip to content

Commit

Permalink
PM / Runtime: Lenient generic runtime pm callbacks
Browse files Browse the repository at this point in the history
Allow drivers, that belong to subsystems which use the generic
runtime pm callbacks, not to define runtime pm suspend/resume handlers,
by implicitly assuming success in such cases.

This is needed to eliminate nop handlers that would otherwise be
necessary by drivers which enable runtime pm, but don't need
to do anything when their devices are runtime-suspended/resumed.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
  • Loading branch information
Ohad Ben-Cohen authored and Rafael J. Wysocki committed Oct 16, 2010
1 parent 2d01971 commit 05aa55d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/base/power/generic_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int pm_generic_runtime_suspend(struct device *dev)
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
int ret;

ret = pm && pm->runtime_suspend ? pm->runtime_suspend(dev) : -EINVAL;
ret = pm && pm->runtime_suspend ? pm->runtime_suspend(dev) : 0;

return ret;
}
Expand All @@ -65,7 +65,7 @@ int pm_generic_runtime_resume(struct device *dev)
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
int ret;

ret = pm && pm->runtime_resume ? pm->runtime_resume(dev) : -EINVAL;
ret = pm && pm->runtime_resume ? pm->runtime_resume(dev) : 0;

return ret;
}
Expand Down

0 comments on commit 05aa55d

Please sign in to comment.