diff options
author | Rabin Vincent <rabin@rab.in> | 2008-08-12 18:08:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-12 19:07:28 -0400 |
commit | 66198f36aac21533245a77aac4a8f7c8c509d8bd (patch) | |
tree | a9723d112a0d78fde318a1f00d99301280a0199f /drivers/cpuidle | |
parent | 001e979d8f0c8fa04b5f01e829805dcd49d9416b (diff) |
cpuidle: make sysfs attributes sysdev class attributes
These attributes are really sysdev class attributes. The incorrect
definition leads to an oops because of recent changes which make sysdev
attributes use a different prototype.
Based on Andi's f718cd4add5aea9d379faff92f162571e356cc5f ("sched: make
scheduler sysfs attributes sysdev class devices")
Reported-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Rabin Vincent <rabin@rab.in>
Acked-by: Andi Kleen <ak@linux.intel.com>
Cc: "Li, Shaohua" <shaohua.li@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/cpuidle')
-rw-r--r-- | drivers/cpuidle/sysfs.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c index 31a0e0b455b6..97b003839fb6 100644 --- a/drivers/cpuidle/sysfs.c +++ b/drivers/cpuidle/sysfs.c | |||
@@ -21,8 +21,8 @@ static int __init cpuidle_sysfs_setup(char *unused) | |||
21 | } | 21 | } |
22 | __setup("cpuidle_sysfs_switch", cpuidle_sysfs_setup); | 22 | __setup("cpuidle_sysfs_switch", cpuidle_sysfs_setup); |
23 | 23 | ||
24 | static ssize_t show_available_governors(struct sys_device *dev, | 24 | static ssize_t show_available_governors(struct sysdev_class *class, |
25 | struct sysdev_attribute *attr, char *buf) | 25 | char *buf) |
26 | { | 26 | { |
27 | ssize_t i = 0; | 27 | ssize_t i = 0; |
28 | struct cpuidle_governor *tmp; | 28 | struct cpuidle_governor *tmp; |
@@ -40,8 +40,8 @@ out: | |||
40 | return i; | 40 | return i; |
41 | } | 41 | } |
42 | 42 | ||
43 | static ssize_t show_current_driver(struct sys_device *dev, | 43 | static ssize_t show_current_driver(struct sysdev_class *class, |
44 | struct sysdev_attribute *attr, char *buf) | 44 | char *buf) |
45 | { | 45 | { |
46 | ssize_t ret; | 46 | ssize_t ret; |
47 | 47 | ||
@@ -55,8 +55,8 @@ static ssize_t show_current_driver(struct sys_device *dev, | |||
55 | return ret; | 55 | return ret; |
56 | } | 56 | } |
57 | 57 | ||
58 | static ssize_t show_current_governor(struct sys_device *dev, | 58 | static ssize_t show_current_governor(struct sysdev_class *class, |
59 | struct sysdev_attribute *attr, char *buf) | 59 | char *buf) |
60 | { | 60 | { |
61 | ssize_t ret; | 61 | ssize_t ret; |
62 | 62 | ||
@@ -70,9 +70,8 @@ static ssize_t show_current_governor(struct sys_device *dev, | |||
70 | return ret; | 70 | return ret; |
71 | } | 71 | } |
72 | 72 | ||
73 | static ssize_t store_current_governor(struct sys_device *dev, | 73 | static ssize_t store_current_governor(struct sysdev_class *class, |
74 | struct sysdev_attribute *attr, | 74 | const char *buf, size_t count) |
75 | const char *buf, size_t count) | ||
76 | { | 75 | { |
77 | char gov_name[CPUIDLE_NAME_LEN]; | 76 | char gov_name[CPUIDLE_NAME_LEN]; |
78 | int ret = -EINVAL; | 77 | int ret = -EINVAL; |
@@ -104,8 +103,9 @@ static ssize_t store_current_governor(struct sys_device *dev, | |||
104 | return count; | 103 | return count; |
105 | } | 104 | } |
106 | 105 | ||
107 | static SYSDEV_ATTR(current_driver, 0444, show_current_driver, NULL); | 106 | static SYSDEV_CLASS_ATTR(current_driver, 0444, show_current_driver, NULL); |
108 | static SYSDEV_ATTR(current_governor_ro, 0444, show_current_governor, NULL); | 107 | static SYSDEV_CLASS_ATTR(current_governor_ro, 0444, show_current_governor, |
108 | NULL); | ||
109 | 109 | ||
110 | static struct attribute *cpuclass_default_attrs[] = { | 110 | static struct attribute *cpuclass_default_attrs[] = { |
111 | &attr_current_driver.attr, | 111 | &attr_current_driver.attr, |
@@ -113,9 +113,10 @@ static struct attribute *cpuclass_default_attrs[] = { | |||
113 | NULL | 113 | NULL |
114 | }; | 114 | }; |
115 | 115 | ||
116 | static SYSDEV_ATTR(available_governors, 0444, show_available_governors, NULL); | 116 | static SYSDEV_CLASS_ATTR(available_governors, 0444, show_available_governors, |
117 | static SYSDEV_ATTR(current_governor, 0644, show_current_governor, | 117 | NULL); |
118 | store_current_governor); | 118 | static SYSDEV_CLASS_ATTR(current_governor, 0644, show_current_governor, |
119 | store_current_governor); | ||
119 | 120 | ||
120 | static struct attribute *cpuclass_switch_attrs[] = { | 121 | static struct attribute *cpuclass_switch_attrs[] = { |
121 | &attr_available_governors.attr, | 122 | &attr_available_governors.attr, |