aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pm.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-02-13 10:29:47 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2012-02-17 17:36:30 -0500
commitc48825251cf5950da9d618144c4db6c130e6c0cd (patch)
tree2e8a163cfaddfdb78243f0ba501b1923e3d7d3be /include/linux/pm.h
parentbc25cf508942c56810d4fb623ef27b56ccef7783 (diff)
PM: Add comment describing relationships between PM callbacks to pm.h
The UNIVERSAL_DEV_PM_OPS() macro is slightly misleading, because it may suggest that it's a good idea to point runtime PM callback pointers to the same routines as system suspend/resume callbacks .suspend() and .resume(), which is not the case. For this reason, add a comment to include/linux/pm.h, next to the definition of UNIVERSAL_DEV_PM_OPS(), describing how device PM callbacks are related to each other. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r--include/linux/pm.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 73c610573a74..d6dd6f612b8d 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -320,6 +320,15 @@ const struct dev_pm_ops name = { \
320/* 320/*
321 * Use this for defining a set of PM operations to be used in all situations 321 * Use this for defining a set of PM operations to be used in all situations
322 * (sustem suspend, hibernation or runtime PM). 322 * (sustem suspend, hibernation or runtime PM).
323 * NOTE: In general, system suspend callbacks, .suspend() and .resume(), should
324 * be different from the corresponding runtime PM callbacks, .runtime_suspend(),
325 * and .runtime_resume(), because .runtime_suspend() always works on an already
326 * quiescent device, while .suspend() should assume that the device may be doing
327 * something when it is called (it should ensure that the device will be
328 * quiescent after it has returned). Therefore it's better to point the "late"
329 * suspend and "early" resume callback pointers, .suspend_late() and
330 * .resume_early(), to the same routines as .runtime_suspend() and
331 * .runtime_resume(), respectively (and analogously for hibernation).
323 */ 332 */
324#define UNIVERSAL_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn) \ 333#define UNIVERSAL_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn) \
325const struct dev_pm_ops name = { \ 334const struct dev_pm_ops name = { \