aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2007-07-12 16:55:07 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-18 18:49:49 -0400
commit471d0558045fe35f8c5f291c1ee63815eb9c2dcd (patch)
tree2be31d11ecc97f0ff537d62b3239e33300ccedae
parent60a96a59569bab85571d0089682109bd3324e896 (diff)
PM: Remove deprecated sysfs files
This patch (as932) removes the deprecated sysfs .../power/state attribute files. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--Documentation/feature-removal-schedule.txt3
-rw-r--r--drivers/base/power/sysfs.c66
-rw-r--r--kernel/power/Kconfig12
3 files changed, 1 insertions, 80 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index d05e6243b4df..9cf9d8346289 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -26,8 +26,7 @@ Who: Hans Verkuil <hverkuil@xs4all.nl> and
26 26
27--------------------------- 27---------------------------
28 28
29What: /sys/devices/.../power/state 29What: dev->power.power_state
30 dev->power.power_state
31 dpm_runtime_{suspend,resume)() 30 dpm_runtime_{suspend,resume)()
32When: July 2007 31When: July 2007
33Why: Broken design for runtime control over driver power states, confusing 32Why: Broken design for runtime control over driver power states, confusing
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c
index 2d47517dbe32..f2ed179cd695 100644
--- a/drivers/base/power/sysfs.c
+++ b/drivers/base/power/sysfs.c
@@ -7,69 +7,6 @@
7#include "power.h" 7#include "power.h"
8 8
9 9
10#ifdef CONFIG_PM_SYSFS_DEPRECATED
11
12/**
13 * state - Control current power state of device
14 *
15 * show() returns the current power state of the device. '0' indicates
16 * the device is on. Other values (2) indicate the device is in some low
17 * power state.
18 *
19 * store() sets the current power state, which is an integer valued
20 * 0, 2, or 3. Devices with bus.suspend_late(), or bus.resume_early()
21 * methods fail this operation; those methods couldn't be called.
22 * Otherwise,
23 *
24 * - If the recorded dev->power.power_state.event matches the
25 * target value, nothing is done.
26 * - If the recorded event code is nonzero, the device is reactivated
27 * by calling bus.resume() and/or class.resume().
28 * - If the target value is nonzero, the device is suspended by
29 * calling class.suspend() and/or bus.suspend() with event code
30 * PM_EVENT_SUSPEND.
31 *
32 * This mechanism is DEPRECATED and should only be used for testing.
33 */
34
35static ssize_t state_show(struct device * dev, struct device_attribute *attr, char * buf)
36{
37 if (dev->power.power_state.event)
38 return sprintf(buf, "2\n");
39 else
40 return sprintf(buf, "0\n");
41}
42
43static ssize_t state_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t n)
44{
45 pm_message_t state;
46 int error = -EINVAL;
47
48 /* disallow incomplete suspend sequences */
49 if (dev->bus && (dev->bus->suspend_late || dev->bus->resume_early))
50 return error;
51
52 state.event = PM_EVENT_SUSPEND;
53 /* Older apps expected to write "3" here - confused with PCI D3 */
54 if ((n == 1) && !strcmp(buf, "3"))
55 error = dpm_runtime_suspend(dev, state);
56
57 if ((n == 1) && !strcmp(buf, "2"))
58 error = dpm_runtime_suspend(dev, state);
59
60 if ((n == 1) && !strcmp(buf, "0")) {
61 dpm_runtime_resume(dev);
62 error = 0;
63 }
64
65 return error ? error : n;
66}
67
68static DEVICE_ATTR(state, 0644, state_show, state_store);
69
70
71#endif /* CONFIG_PM_SYSFS_DEPRECATED */
72
73/* 10/*
74 * wakeup - Report/change current wakeup option for device 11 * wakeup - Report/change current wakeup option for device
75 * 12 *
@@ -143,9 +80,6 @@ static DEVICE_ATTR(wakeup, 0644, wake_show, wake_store);
143 80
144 81
145static struct attribute * power_attrs[] = { 82static struct attribute * power_attrs[] = {
146#ifdef CONFIG_PM_SYSFS_DEPRECATED
147 &dev_attr_state.attr,
148#endif
149 &dev_attr_wakeup.attr, 83 &dev_attr_wakeup.attr,
150 NULL, 84 NULL,
151}; 85};
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
index 495b7d4dd330..73328476761c 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -65,18 +65,6 @@ config PM_TRACE
65 CAUTION: this option will cause your machine's real-time clock to be 65 CAUTION: this option will cause your machine's real-time clock to be
66 set to an invalid time after a resume. 66 set to an invalid time after a resume.
67 67
68config PM_SYSFS_DEPRECATED
69 bool "Driver model /sys/devices/.../power/state files (DEPRECATED)"
70 depends on PM && SYSFS
71 default n
72 help
73 The driver model started out with a sysfs file intended to provide
74 a userspace hook for device power management. This feature has never
75 worked very well, except for limited testing purposes, and so it will
76 be removed. It's not clear that a generic mechanism could really
77 handle the wide variability of device power states; any replacements
78 are likely to be bus or driver specific.
79
80config SOFTWARE_SUSPEND 68config SOFTWARE_SUSPEND
81 bool "Software Suspend (Hibernation)" 69 bool "Software Suspend (Hibernation)"
82 depends on PM && SWAP && (((X86 || PPC64_SWSUSP) && (!SMP || SUSPEND_SMP)) || ((FRV || PPC32) && !SMP)) 70 depends on PM && SWAP && (((X86 || PPC64_SWSUSP) && (!SMP || SUSPEND_SMP)) || ((FRV || PPC32) && !SMP))