diff options
author | David Brownell <david-b@pacbell.net> | 2006-08-30 16:54:36 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-26 00:08:37 -0400 |
commit | 2bca293e56b6a8cd16bb6e70a09b2adac9c723b5 (patch) | |
tree | a67697a05fa718a2a03b603d8afbdcbae41d68bc | |
parent | 047bda36150d11422b2c7bacca1df324c909c0b3 (diff) |
PM: add kconfig option for deprecated .../power/state files
Add a new PM_SYSFS_DEPRECATED config option to control whether or
not the /sys/devices/.../power/state files are provided. This will
make it easier to get rid of that mechanism when the time comes,
and to verify that userspace tools work right without it.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/base/power/sysfs.c | 6 | ||||
-rw-r--r-- | kernel/power/Kconfig | 11 |
2 files changed, 17 insertions, 0 deletions
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c index e55b3c2779e9..2d47517dbe32 100644 --- a/drivers/base/power/sysfs.c +++ b/drivers/base/power/sysfs.c | |||
@@ -7,6 +7,8 @@ | |||
7 | #include "power.h" | 7 | #include "power.h" |
8 | 8 | ||
9 | 9 | ||
10 | #ifdef CONFIG_PM_SYSFS_DEPRECATED | ||
11 | |||
10 | /** | 12 | /** |
11 | * state - Control current power state of device | 13 | * state - Control current power state of device |
12 | * | 14 | * |
@@ -66,6 +68,8 @@ static ssize_t state_store(struct device * dev, struct device_attribute *attr, c | |||
66 | static DEVICE_ATTR(state, 0644, state_show, state_store); | 68 | static DEVICE_ATTR(state, 0644, state_show, state_store); |
67 | 69 | ||
68 | 70 | ||
71 | #endif /* CONFIG_PM_SYSFS_DEPRECATED */ | ||
72 | |||
69 | /* | 73 | /* |
70 | * wakeup - Report/change current wakeup option for device | 74 | * wakeup - Report/change current wakeup option for device |
71 | * | 75 | * |
@@ -139,7 +143,9 @@ static DEVICE_ATTR(wakeup, 0644, wake_show, wake_store); | |||
139 | 143 | ||
140 | 144 | ||
141 | static struct attribute * power_attrs[] = { | 145 | static struct attribute * power_attrs[] = { |
146 | #ifdef CONFIG_PM_SYSFS_DEPRECATED | ||
142 | &dev_attr_state.attr, | 147 | &dev_attr_state.attr, |
148 | #endif | ||
143 | &dev_attr_wakeup.attr, | 149 | &dev_attr_wakeup.attr, |
144 | NULL, | 150 | NULL, |
145 | }; | 151 | }; |
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig index 619ecabf7c58..1ed972070d19 100644 --- a/kernel/power/Kconfig +++ b/kernel/power/Kconfig | |||
@@ -53,6 +53,17 @@ config PM_TRACE | |||
53 | CAUTION: this option will cause your machine's real-time clock to be | 53 | CAUTION: this option will cause your machine's real-time clock to be |
54 | set to an invalid time after a resume. | 54 | set to an invalid time after a resume. |
55 | 55 | ||
56 | config PM_SYSFS_DEPRECATED | ||
57 | bool "Driver model /sys/devices/.../power/state files (DEPRECATED)" | ||
58 | depends on PM && SYSFS | ||
59 | default n | ||
60 | help | ||
61 | The driver model started out with a sysfs file intended to provide | ||
62 | a userspace hook for device power management. This feature has never | ||
63 | worked very well, except for limited testing purposes, and so it will | ||
64 | be removed. It's not clear that a generic mechanism could really | ||
65 | handle the wide variability of device power states; any replacements | ||
66 | are likely to be bus or driver specific. | ||
56 | 67 | ||
57 | config SOFTWARE_SUSPEND | 68 | config SOFTWARE_SUSPEND |
58 | bool "Software Suspend" | 69 | bool "Software Suspend" |