summaryrefslogtreecommitdiff
path: root/include/linux/pm.h
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2009-03-04 14:44:00 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2009-03-25 02:38:26 +0300
commitffa6a7054d172a2f57248dff2de600ca795c5656 (patch)
treef93c6234bb90295c52fcef09e367ed77ff6c3645 /include/linux/pm.h
parent60530afe1ee8a5532cb09d0ab5bc3f1a6495b780 (diff)
downloadlinux-ffa6a7054d172a2f57248dff2de600ca795c5656.tar.xz
Driver core: Fix device_move() vs. dpm list ordering, v2
dpm_list currently relies on the fact that child devices will be registered after their parents to get a correct suspend order. Using device_move() however destroys this assumption, as an already registered device may be moved under a newly registered one. This patch adds a new argument to device_move(), allowing callers to specify how dpm_list should be adapted. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r--include/linux/pm.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 24ba5f67b3a3..1d4e2d289821 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -400,6 +400,9 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
#else /* !CONFIG_PM_SLEEP */
+#define device_pm_lock() do {} while (0)
+#define device_pm_unlock() do {} while (0)
+
static inline int device_suspend(pm_message_t state)
{
return 0;
@@ -409,6 +412,14 @@ static inline int device_suspend(pm_message_t state)
#endif /* !CONFIG_PM_SLEEP */
+/* How to reorder dpm_list after device_move() */
+enum dpm_order {
+ DPM_ORDER_NONE,
+ DPM_ORDER_DEV_AFTER_PARENT,
+ DPM_ORDER_PARENT_BEFORE_DEV,
+ DPM_ORDER_DEV_LAST,
+};
+
/*
* Global Power Management flags
* Used to keep APM and ACPI from both being active