aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndi Kleen <andi@firstfloor.org>2008-07-01 12:48:41 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-07-22 00:55:02 -0400
commit4a0b2b4dbe1335b8b9886ba3dc85a145d5d938ed (patch)
treec2d3a0f86ade5061a1bb9a14aa702323d729fd54
parent36ce6dad6e3cb3f050ed41e0beac0070d2062b25 (diff)
sysdev: Pass the attribute to the low level sysdev show/store function
This allow to dynamically generate attributes and share show/store functions between attributes. Right now most attributes are generated by special macros and lots of duplicated code. With the attribute passed it's instead possible to attach some data to the attribute and then use that in shared low level functions to do different things. I need this for the dynamically generated bank attributes in the x86 machine check code, but it'll allow some further cleanups. I converted all users in tree to the new show/store prototype. It's a single huge patch to avoid unbisectable sections. Runtime tested: x86-32, x86-64 Compiled only: ia64, powerpc Not compile tested/only grep converted: sh, arm, avr32 Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--arch/arm/kernel/time.c4
-rw-r--r--arch/avr32/kernel/cpu.c38
-rw-r--r--arch/ia64/kernel/err_inject.c22
-rw-r--r--arch/powerpc/kernel/sysfs.c15
-rw-r--r--arch/powerpc/platforms/cell/cbe_thermal.c45
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c3
-rw-r--r--arch/s390/kernel/smp.c36
-rw-r--r--arch/s390/kernel/time.c35
-rw-r--r--arch/sh/drivers/dma/dma-sysfs.c15
-rw-r--r--arch/sparc64/kernel/sysfs.c16
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_64.c14
-rw-r--r--arch/x86/kernel/cpu/mcheck/therm_throt.c1
-rw-r--r--arch/x86/kernel/microcode.c10
-rw-r--r--drivers/base/cpu.c10
-rw-r--r--drivers/base/memory.c12
-rw-r--r--drivers/base/node.c15
-rw-r--r--drivers/base/sys.c4
-rw-r--r--drivers/base/topology.c17
-rw-r--r--drivers/cpuidle/sysfs.c10
-rw-r--r--drivers/xen/balloon.c1
-rw-r--r--include/linux/sysdev.h5
-rw-r--r--kernel/rtmutex-tester.c7
-rw-r--r--kernel/sched.c8
-rw-r--r--kernel/time/clocksource.c8
24 files changed, 239 insertions, 112 deletions
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index cc5145b28e7f..368d171754cf 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -130,7 +130,9 @@ static const struct leds_evt_name evt_names[] = {
130 { "red", led_red_on, led_red_off }, 130 { "red", led_red_on, led_red_off },
131}; 131};
132 132
133static ssize_t leds_store(struct sys_device *dev, const char *buf, size_t size) 133static ssize_t leds_store(struct sys_device *dev,
134 struct sysdev_attribute *attr,
135 const char *buf, size_t size)
134{ 136{
135 int ret = -EINVAL, len = strcspn(buf, " "); 137 int ret = -EINVAL, len = strcspn(buf, " ");
136 138
diff --git a/arch/avr32/kernel/cpu.c b/arch/avr32/kernel/cpu.c
index b8409caeb23d..e84faffbbeca 100644
--- a/arch/avr32/kernel/cpu.c
+++ b/arch/avr32/kernel/cpu.c
@@ -26,14 +26,16 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices);
26 * XXX: If/when a SMP-capable implementation of AVR32 will ever be 26 * XXX: If/when a SMP-capable implementation of AVR32 will ever be
27 * made, we must make sure that the code executes on the correct CPU. 27 * made, we must make sure that the code executes on the correct CPU.
28 */ 28 */
29static ssize_t show_pc0event(struct sys_device *dev, char *buf) 29static ssize_t show_pc0event(struct sys_device *dev,
30 struct sysdev_attribute *attr, char *buf)
30{ 31{
31 unsigned long pccr; 32 unsigned long pccr;
32 33
33 pccr = sysreg_read(PCCR); 34 pccr = sysreg_read(PCCR);
34 return sprintf(buf, "0x%lx\n", (pccr >> 12) & 0x3f); 35 return sprintf(buf, "0x%lx\n", (pccr >> 12) & 0x3f);
35} 36}
36static ssize_t store_pc0event(struct sys_device *dev, const char *buf, 37static ssize_t store_pc0event(struct sys_device *dev,
38 struct sysdev_attribute *attr, const char *buf,
37 size_t count) 39 size_t count)
38{ 40{
39 unsigned long val; 41 unsigned long val;
@@ -46,15 +48,17 @@ static ssize_t store_pc0event(struct sys_device *dev, const char *buf,
46 sysreg_write(PCCR, val); 48 sysreg_write(PCCR, val);
47 return count; 49 return count;
48} 50}
49static ssize_t show_pc0count(struct sys_device *dev, char *buf) 51static ssize_t show_pc0count(struct sys_device *dev,
52 struct sysdev_attribute *attr, char *buf)
50{ 53{
51 unsigned long pcnt0; 54 unsigned long pcnt0;
52 55
53 pcnt0 = sysreg_read(PCNT0); 56 pcnt0 = sysreg_read(PCNT0);
54 return sprintf(buf, "%lu\n", pcnt0); 57 return sprintf(buf, "%lu\n", pcnt0);
55} 58}
56static ssize_t store_pc0count(struct sys_device *dev, const char *buf, 59static ssize_t store_pc0count(struct sys_device *dev,
57 size_t count) 60 struct sysdev_attribute *attr,
61 const char *buf, size_t count)
58{ 62{
59 unsigned long val; 63 unsigned long val;
60 char *endp; 64 char *endp;
@@ -67,14 +71,16 @@ static ssize_t store_pc0count(struct sys_device *dev, const char *buf,
67 return count; 71 return count;
68} 72}
69 73
70static ssize_t show_pc1event(struct sys_device *dev, char *buf) 74static ssize_t show_pc1event(struct sys_device *dev,
75 struct sysdev_attribute *attr, char *buf)
71{ 76{
72 unsigned long pccr; 77 unsigned long pccr;
73 78
74 pccr = sysreg_read(PCCR); 79 pccr = sysreg_read(PCCR);
75 return sprintf(buf, "0x%lx\n", (pccr >> 18) & 0x3f); 80 return sprintf(buf, "0x%lx\n", (pccr >> 18) & 0x3f);
76} 81}
77static ssize_t store_pc1event(struct sys_device *dev, const char *buf, 82static ssize_t store_pc1event(struct sys_device *dev,
83 struct sysdev_attribute *attr, const char *buf,
78 size_t count) 84 size_t count)
79{ 85{
80 unsigned long val; 86 unsigned long val;
@@ -87,14 +93,16 @@ static ssize_t store_pc1event(struct sys_device *dev, const char *buf,
87 sysreg_write(PCCR, val); 93 sysreg_write(PCCR, val);
88 return count; 94 return count;
89} 95}
90static ssize_t show_pc1count(struct sys_device *dev, char *buf) 96static ssize_t show_pc1count(struct sys_device *dev,
97 struct sysdev_attribute *attr, char *buf)
91{ 98{
92 unsigned long pcnt1; 99 unsigned long pcnt1;
93 100
94 pcnt1 = sysreg_read(PCNT1); 101 pcnt1 = sysreg_read(PCNT1);
95 return sprintf(buf, "%lu\n", pcnt1); 102 return sprintf(buf, "%lu\n", pcnt1);
96} 103}
97static ssize_t store_pc1count(struct sys_device *dev, const char *buf, 104static ssize_t store_pc1count(struct sys_device *dev,
105 struct sysdev_attribute *attr, const char *buf,
98 size_t count) 106 size_t count)
99{ 107{
100 unsigned long val; 108 unsigned long val;
@@ -108,14 +116,16 @@ static ssize_t store_pc1count(struct sys_device *dev, const char *buf,
108 return count; 116 return count;
109} 117}
110 118
111static ssize_t show_pccycles(struct sys_device *dev, char *buf) 119static ssize_t show_pccycles(struct sys_device *dev,
120 struct sysdev_attribute *attr, char *buf)
112{ 121{
113 unsigned long pccnt; 122 unsigned long pccnt;
114 123
115 pccnt = sysreg_read(PCCNT); 124 pccnt = sysreg_read(PCCNT);
116 return sprintf(buf, "%lu\n", pccnt); 125 return sprintf(buf, "%lu\n", pccnt);
117} 126}
118static ssize_t store_pccycles(struct sys_device *dev, const char *buf, 127static ssize_t store_pccycles(struct sys_device *dev,
128 struct sysdev_attribute *attr, const char *buf,
119 size_t count) 129 size_t count)
120{ 130{
121 unsigned long val; 131 unsigned long val;
@@ -129,14 +139,16 @@ static ssize_t store_pccycles(struct sys_device *dev, const char *buf,
129 return count; 139 return count;
130} 140}
131 141
132static ssize_t show_pcenable(struct sys_device *dev, char *buf) 142static ssize_t show_pcenable(struct sys_device *dev,
143 struct sysdev_attribute *attr, char *buf)
133{ 144{
134 unsigned long pccr; 145 unsigned long pccr;
135 146
136 pccr = sysreg_read(PCCR); 147 pccr = sysreg_read(PCCR);
137 return sprintf(buf, "%c\n", (pccr & 1)?'1':'0'); 148 return sprintf(buf, "%c\n", (pccr & 1)?'1':'0');
138} 149}
139static ssize_t store_pcenable(struct sys_device *dev, const char *buf, 150static ssize_t store_pcenable(struct sys_device *dev,
151 struct sysdev_attribute *attr, const char *buf,
140 size_t count) 152 size_t count)
141{ 153{
142 unsigned long pccr, val; 154 unsigned long pccr, val;
diff --git a/arch/ia64/kernel/err_inject.c b/arch/ia64/kernel/err_inject.c
index b642648cc2ac..c539c689493b 100644
--- a/arch/ia64/kernel/err_inject.c
+++ b/arch/ia64/kernel/err_inject.c
@@ -55,7 +55,8 @@ static u64 resources[NR_CPUS];
55 55
56#define show(name) \ 56#define show(name) \
57static ssize_t \ 57static ssize_t \
58show_##name(struct sys_device *dev, char *buf) \ 58show_##name(struct sys_device *dev, struct sysdev_attribute *attr, \
59 char *buf) \
59{ \ 60{ \
60 u32 cpu=dev->id; \ 61 u32 cpu=dev->id; \
61 return sprintf(buf, "%lx\n", name[cpu]); \ 62 return sprintf(buf, "%lx\n", name[cpu]); \
@@ -63,7 +64,8 @@ show_##name(struct sys_device *dev, char *buf) \
63 64
64#define store(name) \ 65#define store(name) \
65static ssize_t \ 66static ssize_t \
66store_##name(struct sys_device *dev, const char *buf, size_t size) \ 67store_##name(struct sys_device *dev, struct sysdev_attribute *attr, \
68 const char *buf, size_t size) \
67{ \ 69{ \
68 unsigned int cpu=dev->id; \ 70 unsigned int cpu=dev->id; \
69 name[cpu] = simple_strtoull(buf, NULL, 16); \ 71 name[cpu] = simple_strtoull(buf, NULL, 16); \
@@ -76,7 +78,8 @@ show(call_start)
76 * processor. The cpu number in driver is only used for storing data. 78 * processor. The cpu number in driver is only used for storing data.
77 */ 79 */
78static ssize_t 80static ssize_t
79store_call_start(struct sys_device *dev, const char *buf, size_t size) 81store_call_start(struct sys_device *dev, struct sysdev_attribute *attr,
82 const char *buf, size_t size)
80{ 83{
81 unsigned int cpu=dev->id; 84 unsigned int cpu=dev->id;
82 unsigned long call_start = simple_strtoull(buf, NULL, 16); 85 unsigned long call_start = simple_strtoull(buf, NULL, 16);
@@ -124,14 +127,16 @@ show(err_type_info)
124store(err_type_info) 127store(err_type_info)
125 128
126static ssize_t 129static ssize_t
127show_virtual_to_phys(struct sys_device *dev, char *buf) 130show_virtual_to_phys(struct sys_device *dev, struct sysdev_attribute *attr,
131 char *buf)
128{ 132{
129 unsigned int cpu=dev->id; 133 unsigned int cpu=dev->id;
130 return sprintf(buf, "%lx\n", phys_addr[cpu]); 134 return sprintf(buf, "%lx\n", phys_addr[cpu]);
131} 135}
132 136
133static ssize_t 137static ssize_t
134store_virtual_to_phys(struct sys_device *dev, const char *buf, size_t size) 138store_virtual_to_phys(struct sys_device *dev, struct sysdev_attribute *attr,
139 const char *buf, size_t size)
135{ 140{
136 unsigned int cpu=dev->id; 141 unsigned int cpu=dev->id;
137 u64 virt_addr=simple_strtoull(buf, NULL, 16); 142 u64 virt_addr=simple_strtoull(buf, NULL, 16);
@@ -154,7 +159,8 @@ show(err_struct_info)
154store(err_struct_info) 159store(err_struct_info)
155 160
156static ssize_t 161static ssize_t
157show_err_data_buffer(struct sys_device *dev, char *buf) 162show_err_data_buffer(struct sys_device *dev,
163 struct sysdev_attribute *attr, char *buf)
158{ 164{
159 unsigned int cpu=dev->id; 165 unsigned int cpu=dev->id;
160 166
@@ -165,7 +171,9 @@ show_err_data_buffer(struct sys_device *dev, char *buf)
165} 171}
166 172
167static ssize_t 173static ssize_t
168store_err_data_buffer(struct sys_device *dev, const char *buf, size_t size) 174store_err_data_buffer(struct sys_device *dev,
175 struct sysdev_attribute *attr,
176 const char *buf, size_t size)
169{ 177{
170 unsigned int cpu=dev->id; 178 unsigned int cpu=dev->id;
171 int ret; 179 int ret;
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index c8127f832df0..aba0ba95f062 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -28,7 +28,9 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices);
28/* Time in microseconds we delay before sleeping in the idle loop */ 28/* Time in microseconds we delay before sleeping in the idle loop */
29DEFINE_PER_CPU(unsigned long, smt_snooze_delay) = { 100 }; 29DEFINE_PER_CPU(unsigned long, smt_snooze_delay) = { 100 };
30 30
31static ssize_t store_smt_snooze_delay(struct sys_device *dev, const char *buf, 31static ssize_t store_smt_snooze_delay(struct sys_device *dev,
32 struct sysdev_attribute *attr,
33 const char *buf,
32 size_t count) 34 size_t count)
33{ 35{
34 struct cpu *cpu = container_of(dev, struct cpu, sysdev); 36 struct cpu *cpu = container_of(dev, struct cpu, sysdev);
@@ -44,7 +46,9 @@ static ssize_t store_smt_snooze_delay(struct sys_device *dev, const char *buf,
44 return count; 46 return count;
45} 47}
46 48
47static ssize_t show_smt_snooze_delay(struct sys_device *dev, char *buf) 49static ssize_t show_smt_snooze_delay(struct sys_device *dev,
50 struct sysdev_attribute *attr,
51 char *buf)
48{ 52{
49 struct cpu *cpu = container_of(dev, struct cpu, sysdev); 53 struct cpu *cpu = container_of(dev, struct cpu, sysdev);
50 54
@@ -152,14 +156,17 @@ static unsigned long write_##NAME(unsigned long val) \
152 mtspr(ADDRESS, val); \ 156 mtspr(ADDRESS, val); \
153 return 0; \ 157 return 0; \
154} \ 158} \
155static ssize_t show_##NAME(struct sys_device *dev, char *buf) \ 159static ssize_t show_##NAME(struct sys_device *dev, \
160 struct sysdev_attribute *attr, \
161 char *buf) \
156{ \ 162{ \
157 struct cpu *cpu = container_of(dev, struct cpu, sysdev); \ 163 struct cpu *cpu = container_of(dev, struct cpu, sysdev); \
158 unsigned long val = run_on_cpu(cpu->sysdev.id, read_##NAME, 0); \ 164 unsigned long val = run_on_cpu(cpu->sysdev.id, read_##NAME, 0); \
159 return sprintf(buf, "%lx\n", val); \ 165 return sprintf(buf, "%lx\n", val); \
160} \ 166} \
161static ssize_t __used \ 167static ssize_t __used \
162 store_##NAME(struct sys_device *dev, const char *buf, size_t count) \ 168 store_##NAME(struct sys_device *dev, struct sysdev_attribute *attr, \
169 const char *buf, size_t count) \
163{ \ 170{ \
164 struct cpu *cpu = container_of(dev, struct cpu, sysdev); \ 171 struct cpu *cpu = container_of(dev, struct cpu, sysdev); \
165 unsigned long val; \ 172 unsigned long val; \
diff --git a/arch/powerpc/platforms/cell/cbe_thermal.c b/arch/powerpc/platforms/cell/cbe_thermal.c
index 4852bf312d83..4d4c8c169124 100644
--- a/arch/powerpc/platforms/cell/cbe_thermal.c
+++ b/arch/powerpc/platforms/cell/cbe_thermal.c
@@ -97,7 +97,8 @@ static u8 spu_read_register_value(struct sys_device *sysdev, union spe_reg __iom
97 return value.spe[spu->spe_id]; 97 return value.spe[spu->spe_id];
98} 98}
99 99
100static ssize_t spu_show_temp(struct sys_device *sysdev, char *buf) 100static ssize_t spu_show_temp(struct sys_device *sysdev, struct sysdev_attribute *attr,
101 char *buf)
101{ 102{
102 u8 value; 103 u8 value;
103 struct cbe_pmd_regs __iomem *pmd_regs; 104 struct cbe_pmd_regs __iomem *pmd_regs;
@@ -146,32 +147,38 @@ static ssize_t store_throttle(struct cbe_pmd_regs __iomem *pmd_regs, const char
146 return size; 147 return size;
147} 148}
148 149
149static ssize_t spu_show_throttle_end(struct sys_device *sysdev, char *buf) 150static ssize_t spu_show_throttle_end(struct sys_device *sysdev,
151 struct sysdev_attribute *attr, char *buf)
150{ 152{
151 return show_throttle(get_pmd_regs(sysdev), buf, 0); 153 return show_throttle(get_pmd_regs(sysdev), buf, 0);
152} 154}
153 155
154static ssize_t spu_show_throttle_begin(struct sys_device *sysdev, char *buf) 156static ssize_t spu_show_throttle_begin(struct sys_device *sysdev,
157 struct sysdev_attribute *attr, char *buf)
155{ 158{
156 return show_throttle(get_pmd_regs(sysdev), buf, 8); 159 return show_throttle(get_pmd_regs(sysdev), buf, 8);
157} 160}
158 161
159static ssize_t spu_show_throttle_full_stop(struct sys_device *sysdev, char *buf) 162static ssize_t spu_show_throttle_full_stop(struct sys_device *sysdev,
163 struct sysdev_attribute *attr, char *buf)
160{ 164{
161 return show_throttle(get_pmd_regs(sysdev), buf, 16); 165 return show_throttle(get_pmd_regs(sysdev), buf, 16);
162} 166}
163 167
164static ssize_t spu_store_throttle_end(struct sys_device *sysdev, const char *buf, size_t size) 168static ssize_t spu_store_throttle_end(struct sys_device *sysdev,
169 struct sysdev_attribute *attr, const char *buf, size_t size)
165{ 170{
166 return store_throttle(get_pmd_regs(sysdev), buf, size, 0); 171 return store_throttle(get_pmd_regs(sysdev), buf, size, 0);
167} 172}
168 173
169static ssize_t spu_store_throttle_begin(struct sys_device *sysdev, const char *buf, size_t size) 174static ssize_t spu_store_throttle_begin(struct sys_device *sysdev,
175 struct sysdev_attribute *attr, const char *buf, size_t size)
170{ 176{
171 return store_throttle(get_pmd_regs(sysdev), buf, size, 8); 177 return store_throttle(get_pmd_regs(sysdev), buf, size, 8);
172} 178}
173 179
174static ssize_t spu_store_throttle_full_stop(struct sys_device *sysdev, const char *buf, size_t size) 180static ssize_t spu_store_throttle_full_stop(struct sys_device *sysdev,
181 struct sysdev_attribute *attr, const char *buf, size_t size)
175{ 182{
176 return store_throttle(get_pmd_regs(sysdev), buf, size, 16); 183 return store_throttle(get_pmd_regs(sysdev), buf, size, 16);
177} 184}
@@ -192,43 +199,51 @@ static ssize_t ppe_show_temp(struct sys_device *sysdev, char *buf, int pos)
192 199
193/* shows the temperature of the DTS on the PPE, 200/* shows the temperature of the DTS on the PPE,
194 * located near the linear thermal sensor */ 201 * located near the linear thermal sensor */
195static ssize_t ppe_show_temp0(struct sys_device *sysdev, char *buf) 202static ssize_t ppe_show_temp0(struct sys_device *sysdev,
203 struct sysdev_attribute *attr, char *buf)
196{ 204{
197 return ppe_show_temp(sysdev, buf, 32); 205 return ppe_show_temp(sysdev, buf, 32);
198} 206}
199 207
200/* shows the temperature of the second DTS on the PPE */ 208/* shows the temperature of the second DTS on the PPE */
201static ssize_t ppe_show_temp1(struct sys_device *sysdev, char *buf) 209static ssize_t ppe_show_temp1(struct sys_device *sysdev,
210 struct sysdev_attribute *attr, char *buf)
202{ 211{
203 return ppe_show_temp(sysdev, buf, 0); 212 return ppe_show_temp(sysdev, buf, 0);
204} 213}
205 214
206static ssize_t ppe_show_throttle_end(struct sys_device *sysdev, char *buf) 215static ssize_t ppe_show_throttle_end(struct sys_device *sysdev,
216 struct sysdev_attribute *attr, char *buf)
207{ 217{
208 return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 32); 218 return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 32);
209} 219}
210 220
211static ssize_t ppe_show_throttle_begin(struct sys_device *sysdev, char *buf) 221static ssize_t ppe_show_throttle_begin(struct sys_device *sysdev,
222 struct sysdev_attribute *attr, char *buf)
212{ 223{
213 return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 40); 224 return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 40);
214} 225}
215 226
216static ssize_t ppe_show_throttle_full_stop(struct sys_device *sysdev, char *buf) 227static ssize_t ppe_show_throttle_full_stop(struct sys_device *sysdev,
228 struct sysdev_attribute *attr, char *buf)
217{ 229{
218 return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 48); 230 return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 48);
219} 231}
220 232
221static ssize_t ppe_store_throttle_end(struct sys_device *sysdev, const char *buf, size_t size) 233static ssize_t ppe_store_throttle_end(struct sys_device *sysdev,
234 struct sysdev_attribute *attr, const char *buf, size_t size)
222{ 235{
223 return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 32); 236 return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 32);
224} 237}
225 238
226static ssize_t ppe_store_throttle_begin(struct sys_device *sysdev, const char *buf, size_t size) 239static ssize_t ppe_store_throttle_begin(struct sys_device *sysdev,
240 struct sysdev_attribute *attr, const char *buf, size_t size)
227{ 241{
228 return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 40); 242 return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 40);
229} 243}
230 244
231static ssize_t ppe_store_throttle_full_stop(struct sys_device *sysdev, const char *buf, size_t size) 245static ssize_t ppe_store_throttle_full_stop(struct sys_device *sysdev,
246 struct sysdev_attribute *attr, const char *buf, size_t size)
232{ 247{
233 return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 48); 248 return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 48);
234} 249}
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index 78f905bc6a42..a5bdb89a17c3 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -703,7 +703,8 @@ static unsigned long long spu_acct_time(struct spu *spu,
703} 703}
704 704
705 705
706static ssize_t spu_stat_show(struct sys_device *sysdev, char *buf) 706static ssize_t spu_stat_show(struct sys_device *sysdev,
707 struct sysdev_attribute *attr, char *buf)
707{ 708{
708 struct spu *spu = container_of(sysdev, struct spu, sysdev); 709 struct spu *spu = container_of(sysdev, struct spu, sysdev);
709 710
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index b6781030cfbd..b795b3e24afd 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -864,7 +864,8 @@ int setup_profiling_timer(unsigned int multiplier)
864} 864}
865 865
866#ifdef CONFIG_HOTPLUG_CPU 866#ifdef CONFIG_HOTPLUG_CPU
867static ssize_t cpu_configure_show(struct sys_device *dev, char *buf) 867static ssize_t cpu_configure_show(struct sys_device *dev,
868 struct sysdev_attribute *attr, char *buf)
868{ 869{
869 ssize_t count; 870 ssize_t count;
870 871
@@ -874,8 +875,9 @@ static ssize_t cpu_configure_show(struct sys_device *dev, char *buf)
874 return count; 875 return count;
875} 876}
876 877
877static ssize_t cpu_configure_store(struct sys_device *dev, const char *buf, 878static ssize_t cpu_configure_store(struct sys_device *dev,
878 size_t count) 879 struct sysdev_attribute *attr,
880 const char *buf, size_t count)
879{ 881{
880 int cpu = dev->id; 882 int cpu = dev->id;
881 int val, rc; 883 int val, rc;
@@ -922,7 +924,8 @@ out:
922static SYSDEV_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store); 924static SYSDEV_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store);
923#endif /* CONFIG_HOTPLUG_CPU */ 925#endif /* CONFIG_HOTPLUG_CPU */
924 926
925static ssize_t cpu_polarization_show(struct sys_device *dev, char *buf) 927static ssize_t cpu_polarization_show(struct sys_device *dev,
928 struct sysdev_attribute *attr, char *buf)
926{ 929{
927 int cpu = dev->id; 930 int cpu = dev->id;
928 ssize_t count; 931 ssize_t count;
@@ -950,7 +953,8 @@ static ssize_t cpu_polarization_show(struct sys_device *dev, char *buf)
950} 953}
951static SYSDEV_ATTR(polarization, 0444, cpu_polarization_show, NULL); 954static SYSDEV_ATTR(polarization, 0444, cpu_polarization_show, NULL);
952 955
953static ssize_t show_cpu_address(struct sys_device *dev, char *buf) 956static ssize_t show_cpu_address(struct sys_device *dev,
957 struct sysdev_attribute *attr, char *buf)
954{ 958{
955 return sprintf(buf, "%d\n", __cpu_logical_map[dev->id]); 959 return sprintf(buf, "%d\n", __cpu_logical_map[dev->id]);
956} 960}
@@ -970,7 +974,8 @@ static struct attribute_group cpu_common_attr_group = {
970 .attrs = cpu_common_attrs, 974 .attrs = cpu_common_attrs,
971}; 975};
972 976
973static ssize_t show_capability(struct sys_device *dev, char *buf) 977static ssize_t show_capability(struct sys_device *dev,
978 struct sysdev_attribute *attr, char *buf)
974{ 979{
975 unsigned int capability; 980 unsigned int capability;
976 int rc; 981 int rc;
@@ -982,7 +987,8 @@ static ssize_t show_capability(struct sys_device *dev, char *buf)
982} 987}
983static SYSDEV_ATTR(capability, 0444, show_capability, NULL); 988static SYSDEV_ATTR(capability, 0444, show_capability, NULL);
984 989
985static ssize_t show_idle_count(struct sys_device *dev, char *buf) 990static ssize_t show_idle_count(struct sys_device *dev,
991 struct sysdev_attribute *attr, char *buf)
986{ 992{
987 struct s390_idle_data *idle; 993 struct s390_idle_data *idle;
988 unsigned long long idle_count; 994 unsigned long long idle_count;
@@ -995,7 +1001,8 @@ static ssize_t show_idle_count(struct sys_device *dev, char *buf)
995} 1001}
996static SYSDEV_ATTR(idle_count, 0444, show_idle_count, NULL); 1002static SYSDEV_ATTR(idle_count, 0444, show_idle_count, NULL);
997 1003
998static ssize_t show_idle_time(struct sys_device *dev, char *buf) 1004static ssize_t show_idle_time(struct sys_device *dev,
1005 struct sysdev_attribute *attr, char *buf)
999{ 1006{
1000 struct s390_idle_data *idle; 1007 struct s390_idle_data *idle;
1001 unsigned long long new_time; 1008 unsigned long long new_time;
@@ -1112,7 +1119,9 @@ out:
1112 return rc; 1119 return rc;
1113} 1120}
1114 1121
1115static ssize_t __ref rescan_store(struct sys_device *dev, const char *buf, 1122static ssize_t __ref rescan_store(struct sys_device *dev,
1123 struct sysdev_attribute *attr,
1124 const char *buf,
1116 size_t count) 1125 size_t count)
1117{ 1126{
1118 int rc; 1127 int rc;
@@ -1123,7 +1132,9 @@ static ssize_t __ref rescan_store(struct sys_device *dev, const char *buf,
1123static SYSDEV_ATTR(rescan, 0200, NULL, rescan_store); 1132static SYSDEV_ATTR(rescan, 0200, NULL, rescan_store);
1124#endif /* CONFIG_HOTPLUG_CPU */ 1133#endif /* CONFIG_HOTPLUG_CPU */
1125 1134
1126static ssize_t dispatching_show(struct sys_device *dev, char *buf) 1135static ssize_t dispatching_show(struct sys_device *dev,
1136 struct sysdev_attribute *attr,
1137 char *buf)
1127{ 1138{
1128 ssize_t count; 1139 ssize_t count;
1129 1140
@@ -1133,8 +1144,9 @@ static ssize_t dispatching_show(struct sys_device *dev, char *buf)
1133 return count; 1144 return count;
1134} 1145}
1135 1146
1136static ssize_t dispatching_store(struct sys_device *dev, const char *buf, 1147static ssize_t dispatching_store(struct sys_device *dev,
1137 size_t count) 1148 struct sysdev_attribute *attr,
1149 const char *buf, size_t count)
1138{ 1150{
1139 int val, rc; 1151 int val, rc;
1140 char delim; 1152 char delim;
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index f2cede3947b2..ab70d9bd9261 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -1100,7 +1100,9 @@ static inline struct etr_aib *etr_aib_from_dev(struct sys_device *dev)
1100 return etr_port1_online ? &etr_port1 : NULL; 1100 return etr_port1_online ? &etr_port1 : NULL;
1101} 1101}
1102 1102
1103static ssize_t etr_online_show(struct sys_device *dev, char *buf) 1103static ssize_t etr_online_show(struct sys_device *dev,
1104 struct sysdev_attribute *attr,
1105 char *buf)
1104{ 1106{
1105 unsigned int online; 1107 unsigned int online;
1106 1108
@@ -1109,7 +1111,8 @@ static ssize_t etr_online_show(struct sys_device *dev, char *buf)
1109} 1111}
1110 1112
1111static ssize_t etr_online_store(struct sys_device *dev, 1113static ssize_t etr_online_store(struct sys_device *dev,
1112 const char *buf, size_t count) 1114 struct sysdev_attribute *attr,
1115 const char *buf, size_t count)
1113{ 1116{
1114 unsigned int value; 1117 unsigned int value;
1115 1118
@@ -1136,7 +1139,9 @@ static ssize_t etr_online_store(struct sys_device *dev,
1136 1139
1137static SYSDEV_ATTR(online, 0600, etr_online_show, etr_online_store); 1140static SYSDEV_ATTR(online, 0600, etr_online_show, etr_online_store);
1138 1141
1139static ssize_t etr_stepping_control_show(struct sys_device *dev, char *buf) 1142static ssize_t etr_stepping_control_show(struct sys_device *dev,
1143 struct sysdev_attribute *attr,
1144 char *buf)
1140{ 1145{
1141 return sprintf(buf, "%i\n", (dev == &etr_port0_dev) ? 1146 return sprintf(buf, "%i\n", (dev == &etr_port0_dev) ?
1142 etr_eacr.e0 : etr_eacr.e1); 1147 etr_eacr.e0 : etr_eacr.e1);
@@ -1144,7 +1149,8 @@ static ssize_t etr_stepping_control_show(struct sys_device *dev, char *buf)
1144 1149
1145static SYSDEV_ATTR(stepping_control, 0400, etr_stepping_control_show, NULL); 1150static SYSDEV_ATTR(stepping_control, 0400, etr_stepping_control_show, NULL);
1146 1151
1147static ssize_t etr_mode_code_show(struct sys_device *dev, char *buf) 1152static ssize_t etr_mode_code_show(struct sys_device *dev,
1153 struct sysdev_attribute *attr, char *buf)
1148{ 1154{
1149 if (!etr_port0_online && !etr_port1_online) 1155 if (!etr_port0_online && !etr_port1_online)
1150 /* Status word is not uptodate if both ports are offline. */ 1156 /* Status word is not uptodate if both ports are offline. */
@@ -1155,7 +1161,8 @@ static ssize_t etr_mode_code_show(struct sys_device *dev, char *buf)
1155 1161
1156static SYSDEV_ATTR(state_code, 0400, etr_mode_code_show, NULL); 1162static SYSDEV_ATTR(state_code, 0400, etr_mode_code_show, NULL);
1157 1163
1158static ssize_t etr_untuned_show(struct sys_device *dev, char *buf) 1164static ssize_t etr_untuned_show(struct sys_device *dev,
1165 struct sysdev_attribute *attr, char *buf)
1159{ 1166{
1160 struct etr_aib *aib = etr_aib_from_dev(dev); 1167 struct etr_aib *aib = etr_aib_from_dev(dev);
1161 1168
@@ -1166,7 +1173,8 @@ static ssize_t etr_untuned_show(struct sys_device *dev, char *buf)
1166 1173
1167static SYSDEV_ATTR(untuned, 0400, etr_untuned_show, NULL); 1174static SYSDEV_ATTR(untuned, 0400, etr_untuned_show, NULL);
1168 1175
1169static ssize_t etr_network_id_show(struct sys_device *dev, char *buf) 1176static ssize_t etr_network_id_show(struct sys_device *dev,
1177 struct sysdev_attribute *attr, char *buf)
1170{ 1178{
1171 struct etr_aib *aib = etr_aib_from_dev(dev); 1179 struct etr_aib *aib = etr_aib_from_dev(dev);
1172 1180
@@ -1177,7 +1185,8 @@ static ssize_t etr_network_id_show(struct sys_device *dev, char *buf)
1177 1185
1178static SYSDEV_ATTR(network, 0400, etr_network_id_show, NULL); 1186static SYSDEV_ATTR(network, 0400, etr_network_id_show, NULL);
1179 1187
1180static ssize_t etr_id_show(struct sys_device *dev, char *buf) 1188static ssize_t etr_id_show(struct sys_device *dev,
1189 struct sysdev_attribute *attr, char *buf)
1181{ 1190{
1182 struct etr_aib *aib = etr_aib_from_dev(dev); 1191 struct etr_aib *aib = etr_aib_from_dev(dev);
1183 1192
@@ -1188,7 +1197,8 @@ static ssize_t etr_id_show(struct sys_device *dev, char *buf)
1188 1197
1189static SYSDEV_ATTR(id, 0400, etr_id_show, NULL); 1198static SYSDEV_ATTR(id, 0400, etr_id_show, NULL);
1190 1199
1191static ssize_t etr_port_number_show(struct sys_device *dev, char *buf) 1200static ssize_t etr_port_number_show(struct sys_device *dev,
1201 struct sysdev_attribute *attr, char *buf)
1192{ 1202{
1193 struct etr_aib *aib = etr_aib_from_dev(dev); 1203 struct etr_aib *aib = etr_aib_from_dev(dev);
1194 1204
@@ -1199,7 +1209,8 @@ static ssize_t etr_port_number_show(struct sys_device *dev, char *buf)
1199 1209
1200static SYSDEV_ATTR(port, 0400, etr_port_number_show, NULL); 1210static SYSDEV_ATTR(port, 0400, etr_port_number_show, NULL);
1201 1211
1202static ssize_t etr_coupled_show(struct sys_device *dev, char *buf) 1212static ssize_t etr_coupled_show(struct sys_device *dev,
1213 struct sysdev_attribute *attr, char *buf)
1203{ 1214{
1204 struct etr_aib *aib = etr_aib_from_dev(dev); 1215 struct etr_aib *aib = etr_aib_from_dev(dev);
1205 1216
@@ -1210,7 +1221,8 @@ static ssize_t etr_coupled_show(struct sys_device *dev, char *buf)
1210 1221
1211static SYSDEV_ATTR(coupled, 0400, etr_coupled_show, NULL); 1222static SYSDEV_ATTR(coupled, 0400, etr_coupled_show, NULL);
1212 1223
1213static ssize_t etr_local_time_show(struct sys_device *dev, char *buf) 1224static ssize_t etr_local_time_show(struct sys_device *dev,
1225 struct sysdev_attribute *attr, char *buf)
1214{ 1226{
1215 struct etr_aib *aib = etr_aib_from_dev(dev); 1227 struct etr_aib *aib = etr_aib_from_dev(dev);
1216 1228
@@ -1221,7 +1233,8 @@ static ssize_t etr_local_time_show(struct sys_device *dev, char *buf)
1221 1233
1222static SYSDEV_ATTR(local_time, 0400, etr_local_time_show, NULL); 1234static SYSDEV_ATTR(local_time, 0400, etr_local_time_show, NULL);
1223 1235
1224static ssize_t etr_utc_offset_show(struct sys_device *dev, char *buf) 1236static ssize_t etr_utc_offset_show(struct sys_device *dev,
1237 struct sysdev_attribute *attr, char *buf)
1225{ 1238{
1226 struct etr_aib *aib = etr_aib_from_dev(dev); 1239 struct etr_aib *aib = etr_aib_from_dev(dev);
1227 1240
diff --git a/arch/sh/drivers/dma/dma-sysfs.c b/arch/sh/drivers/dma/dma-sysfs.c
index 51b57c0d1a3c..347ee11351ec 100644
--- a/arch/sh/drivers/dma/dma-sysfs.c
+++ b/arch/sh/drivers/dma/dma-sysfs.c
@@ -23,7 +23,8 @@ static struct sysdev_class dma_sysclass = {
23}; 23};
24EXPORT_SYMBOL(dma_sysclass); 24EXPORT_SYMBOL(dma_sysclass);
25 25
26static ssize_t dma_show_devices(struct sys_device *dev, char *buf) 26static ssize_t dma_show_devices(struct sys_device *dev,
27 struct sysdev_attribute *attr, char *buf)
27{ 28{
28 ssize_t len = 0; 29 ssize_t len = 0;
29 int i; 30 int i;
@@ -57,13 +58,15 @@ static int __init dma_sysclass_init(void)
57} 58}
58postcore_initcall(dma_sysclass_init); 59postcore_initcall(dma_sysclass_init);
59 60
60static ssize_t dma_show_dev_id(struct sys_device *dev, char *buf) 61static ssize_t dma_show_dev_id(struct sys_device *dev,
62 struct sysdev_attribute *attr, char *buf)
61{ 63{
62 struct dma_channel *channel = to_dma_channel(dev); 64 struct dma_channel *channel = to_dma_channel(dev);
63 return sprintf(buf, "%s\n", channel->dev_id); 65 return sprintf(buf, "%s\n", channel->dev_id);
64} 66}
65 67
66static ssize_t dma_store_dev_id(struct sys_device *dev, 68static ssize_t dma_store_dev_id(struct sys_device *dev,
69 struct sysdev_attribute *attr,
67 const char *buf, size_t count) 70 const char *buf, size_t count)
68{ 71{
69 struct dma_channel *channel = to_dma_channel(dev); 72 struct dma_channel *channel = to_dma_channel(dev);
@@ -74,6 +77,7 @@ static ssize_t dma_store_dev_id(struct sys_device *dev,
74static SYSDEV_ATTR(dev_id, S_IRUGO | S_IWUSR, dma_show_dev_id, dma_store_dev_id); 77static SYSDEV_ATTR(dev_id, S_IRUGO | S_IWUSR, dma_show_dev_id, dma_store_dev_id);
75 78
76static ssize_t dma_store_config(struct sys_device *dev, 79static ssize_t dma_store_config(struct sys_device *dev,
80 struct sysdev_attribute *attr,
77 const char *buf, size_t count) 81 const char *buf, size_t count)
78{ 82{
79 struct dma_channel *channel = to_dma_channel(dev); 83 struct dma_channel *channel = to_dma_channel(dev);
@@ -87,13 +91,15 @@ static ssize_t dma_store_config(struct sys_device *dev,
87 91
88static SYSDEV_ATTR(config, S_IWUSR, NULL, dma_store_config); 92static SYSDEV_ATTR(config, S_IWUSR, NULL, dma_store_config);
89 93
90static ssize_t dma_show_mode(struct sys_device *dev, char *buf) 94static ssize_t dma_show_mode(struct sys_device *dev,
95 struct sysdev_attribute *attr, char *buf)
91{ 96{
92 struct dma_channel *channel = to_dma_channel(dev); 97 struct dma_channel *channel = to_dma_channel(dev);
93 return sprintf(buf, "0x%08x\n", channel->mode); 98 return sprintf(buf, "0x%08x\n", channel->mode);
94} 99}
95 100
96static ssize_t dma_store_mode(struct sys_device *dev, 101static ssize_t dma_store_mode(struct sys_device *dev,
102 struct sysdev_attribute *attr,
97 const char *buf, size_t count) 103 const char *buf, size_t count)
98{ 104{
99 struct dma_channel *channel = to_dma_channel(dev); 105 struct dma_channel *channel = to_dma_channel(dev);
@@ -104,7 +110,8 @@ static ssize_t dma_store_mode(struct sys_device *dev,
104static SYSDEV_ATTR(mode, S_IRUGO | S_IWUSR, dma_show_mode, dma_store_mode); 110static SYSDEV_ATTR(mode, S_IRUGO | S_IWUSR, dma_show_mode, dma_store_mode);
105 111
106#define dma_ro_attr(field, fmt) \ 112#define dma_ro_attr(field, fmt) \
107static ssize_t dma_show_##field(struct sys_device *dev, char *buf) \ 113static ssize_t dma_show_##field(struct sys_device *dev, \
114 struct sysdev_attribute *attr, char *buf)\
108{ \ 115{ \
109 struct dma_channel *channel = to_dma_channel(dev); \ 116 struct dma_channel *channel = to_dma_channel(dev); \
110 return sprintf(buf, fmt, channel->field); \ 117 return sprintf(buf, fmt, channel->field); \
diff --git a/arch/sparc64/kernel/sysfs.c b/arch/sparc64/kernel/sysfs.c
index e885034a6b73..84e5ce146713 100644
--- a/arch/sparc64/kernel/sysfs.c
+++ b/arch/sparc64/kernel/sysfs.c
@@ -14,7 +14,8 @@
14static DEFINE_PER_CPU(struct hv_mmu_statistics, mmu_stats) __attribute__((aligned(64))); 14static DEFINE_PER_CPU(struct hv_mmu_statistics, mmu_stats) __attribute__((aligned(64)));
15 15
16#define SHOW_MMUSTAT_ULONG(NAME) \ 16#define SHOW_MMUSTAT_ULONG(NAME) \
17static ssize_t show_##NAME(struct sys_device *dev, char *buf) \ 17static ssize_t show_##NAME(struct sys_device *dev, \
18 struct sysdev_attribute *attr, char *buf) \
18{ \ 19{ \
19 struct hv_mmu_statistics *p = &per_cpu(mmu_stats, dev->id); \ 20 struct hv_mmu_statistics *p = &per_cpu(mmu_stats, dev->id); \
20 return sprintf(buf, "%lu\n", p->NAME); \ 21 return sprintf(buf, "%lu\n", p->NAME); \
@@ -135,13 +136,16 @@ static unsigned long write_mmustat_enable(unsigned long val)
135 return sun4v_mmustat_conf(ra, &orig_ra); 136 return sun4v_mmustat_conf(ra, &orig_ra);
136} 137}
137 138
138static ssize_t show_mmustat_enable(struct sys_device *s, char *buf) 139static ssize_t show_mmustat_enable(struct sys_device *s,
140 struct sysdev_attribute *attr, char *buf)
139{ 141{
140 unsigned long val = run_on_cpu(s->id, read_mmustat_enable, 0); 142 unsigned long val = run_on_cpu(s->id, read_mmustat_enable, 0);
141 return sprintf(buf, "%lx\n", val); 143 return sprintf(buf, "%lx\n", val);
142} 144}
143 145
144static ssize_t store_mmustat_enable(struct sys_device *s, const char *buf, size_t count) 146static ssize_t store_mmustat_enable(struct sys_device *s,
147 struct sysdev_attribute *attr, const char *buf,
148 size_t count)
145{ 149{
146 unsigned long val, err; 150 unsigned long val, err;
147 int ret = sscanf(buf, "%ld", &val); 151 int ret = sscanf(buf, "%ld", &val);
@@ -179,14 +183,16 @@ static void unregister_mmu_stats(struct sys_device *s)
179#endif 183#endif
180 184
181#define SHOW_CPUDATA_ULONG_NAME(NAME, MEMBER) \ 185#define SHOW_CPUDATA_ULONG_NAME(NAME, MEMBER) \
182static ssize_t show_##NAME(struct sys_device *dev, char *buf) \ 186static ssize_t show_##NAME(struct sys_device *dev, \
187 struct sysdev_attribute *attr, char *buf) \
183{ \ 188{ \
184 cpuinfo_sparc *c = &cpu_data(dev->id); \ 189 cpuinfo_sparc *c = &cpu_data(dev->id); \
185 return sprintf(buf, "%lu\n", c->MEMBER); \ 190 return sprintf(buf, "%lu\n", c->MEMBER); \
186} 191}
187 192
188#define SHOW_CPUDATA_UINT_NAME(NAME, MEMBER) \ 193#define SHOW_CPUDATA_UINT_NAME(NAME, MEMBER) \
189static ssize_t show_##NAME(struct sys_device *dev, char *buf) \ 194static ssize_t show_##NAME(struct sys_device *dev, \
195 struct sysdev_attribute *attr, char *buf) \
190{ \ 196{ \
191 cpuinfo_sparc *c = &cpu_data(dev->id); \ 197 cpuinfo_sparc *c = &cpu_data(dev->id); \
192 return sprintf(buf, "%u\n", c->MEMBER); \ 198 return sprintf(buf, "%u\n", c->MEMBER); \
diff --git a/arch/x86/kernel/cpu/mcheck/mce_64.c b/arch/x86/kernel/cpu/mcheck/mce_64.c
index c4a7ec31394c..e6a4d5f67643 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_64.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_64.c
@@ -762,10 +762,14 @@ DEFINE_PER_CPU(struct sys_device, device_mce);
762 762
763/* Why are there no generic functions for this? */ 763/* Why are there no generic functions for this? */
764#define ACCESSOR(name, var, start) \ 764#define ACCESSOR(name, var, start) \
765 static ssize_t show_ ## name(struct sys_device *s, char *buf) { \ 765 static ssize_t show_ ## name(struct sys_device *s, \
766 struct sysdev_attribute *attr, \
767 char *buf) { \
766 return sprintf(buf, "%lx\n", (unsigned long)var); \ 768 return sprintf(buf, "%lx\n", (unsigned long)var); \
767 } \ 769 } \
768 static ssize_t set_ ## name(struct sys_device *s,const char *buf,size_t siz) { \ 770 static ssize_t set_ ## name(struct sys_device *s, \
771 struct sysdev_attribute *attr, \
772 const char *buf, size_t siz) { \
769 char *end; \ 773 char *end; \
770 unsigned long new = simple_strtoul(buf, &end, 0); \ 774 unsigned long new = simple_strtoul(buf, &end, 0); \
771 if (end == buf) return -EINVAL; \ 775 if (end == buf) return -EINVAL; \
@@ -786,14 +790,16 @@ ACCESSOR(bank3ctl,bank[3],mce_restart())
786ACCESSOR(bank4ctl,bank[4],mce_restart()) 790ACCESSOR(bank4ctl,bank[4],mce_restart())
787ACCESSOR(bank5ctl,bank[5],mce_restart()) 791ACCESSOR(bank5ctl,bank[5],mce_restart())
788 792
789static ssize_t show_trigger(struct sys_device *s, char *buf) 793static ssize_t show_trigger(struct sys_device *s, struct sysdev_attribute *attr,
794 char *buf)
790{ 795{
791 strcpy(buf, trigger); 796 strcpy(buf, trigger);
792 strcat(buf, "\n"); 797 strcat(buf, "\n");
793 return strlen(trigger) + 1; 798 return strlen(trigger) + 1;
794} 799}
795 800
796static ssize_t set_trigger(struct sys_device *s,const char *buf,size_t siz) 801static ssize_t set_trigger(struct sys_device *s, struct sysdev_attribute *attr,
802 const char *buf,size_t siz)
797{ 803{
798 char *p; 804 char *p;
799 int len; 805 int len;
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index 1f4cc48c14c6..d5ae2243f0b9 100644
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -35,6 +35,7 @@ atomic_t therm_throt_en = ATOMIC_INIT(0);
35 35
36#define define_therm_throt_sysdev_show_func(name) \ 36#define define_therm_throt_sysdev_show_func(name) \
37static ssize_t therm_throt_sysdev_show_##name(struct sys_device *dev, \ 37static ssize_t therm_throt_sysdev_show_##name(struct sys_device *dev, \
38 struct sysdev_attribute *attr, \
38 char *buf) \ 39 char *buf) \
39{ \ 40{ \
40 unsigned int cpu = dev->id; \ 41 unsigned int cpu = dev->id; \
diff --git a/arch/x86/kernel/microcode.c b/arch/x86/kernel/microcode.c
index 56b933119a04..fc4790638b69 100644
--- a/arch/x86/kernel/microcode.c
+++ b/arch/x86/kernel/microcode.c
@@ -644,7 +644,9 @@ static void microcode_fini_cpu(int cpu)
644 mutex_unlock(&microcode_mutex); 644 mutex_unlock(&microcode_mutex);
645} 645}
646 646
647static ssize_t reload_store(struct sys_device *dev, const char *buf, size_t sz) 647static ssize_t reload_store(struct sys_device *dev,
648 struct sysdev_attribute *attr,
649 const char *buf, size_t sz)
648{ 650{
649 struct ucode_cpu_info *uci = ucode_cpu_info + dev->id; 651 struct ucode_cpu_info *uci = ucode_cpu_info + dev->id;
650 char *end; 652 char *end;
@@ -674,14 +676,16 @@ static ssize_t reload_store(struct sys_device *dev, const char *buf, size_t sz)
674 return sz; 676 return sz;
675} 677}
676 678
677static ssize_t version_show(struct sys_device *dev, char *buf) 679static ssize_t version_show(struct sys_device *dev,
680 struct sysdev_attribute *attr, char *buf)
678{ 681{
679 struct ucode_cpu_info *uci = ucode_cpu_info + dev->id; 682 struct ucode_cpu_info *uci = ucode_cpu_info + dev->id;
680 683
681 return sprintf(buf, "0x%x\n", uci->rev); 684 return sprintf(buf, "0x%x\n", uci->rev);
682} 685}
683 686
684static ssize_t pf_show(struct sys_device *dev, char *buf) 687static ssize_t pf_show(struct sys_device *dev,
688 struct sysdev_attribute *attr, char *buf)
685{ 689{
686 struct ucode_cpu_info *uci = ucode_cpu_info + dev->id; 690 struct ucode_cpu_info *uci = ucode_cpu_info + dev->id;
687 691
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index e38dfed41d80..20537d507909 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -21,15 +21,16 @@ EXPORT_SYMBOL(cpu_sysdev_class);
21static DEFINE_PER_CPU(struct sys_device *, cpu_sys_devices); 21static DEFINE_PER_CPU(struct sys_device *, cpu_sys_devices);
22 22
23#ifdef CONFIG_HOTPLUG_CPU 23#ifdef CONFIG_HOTPLUG_CPU
24static ssize_t show_online(struct sys_device *dev, char *buf) 24static ssize_t show_online(struct sys_device *dev, struct sysdev_attribute *attr,
25 char *buf)
25{ 26{
26 struct cpu *cpu = container_of(dev, struct cpu, sysdev); 27 struct cpu *cpu = container_of(dev, struct cpu, sysdev);
27 28
28 return sprintf(buf, "%u\n", !!cpu_online(cpu->sysdev.id)); 29 return sprintf(buf, "%u\n", !!cpu_online(cpu->sysdev.id));
29} 30}
30 31
31static ssize_t __ref store_online(struct sys_device *dev, const char *buf, 32static ssize_t __ref store_online(struct sys_device *dev, struct sysdev_attribute *attr,
32 size_t count) 33 const char *buf, size_t count)
33{ 34{
34 struct cpu *cpu = container_of(dev, struct cpu, sysdev); 35 struct cpu *cpu = container_of(dev, struct cpu, sysdev);
35 ssize_t ret; 36 ssize_t ret;
@@ -80,7 +81,8 @@ static inline void register_cpu_control(struct cpu *cpu)
80#ifdef CONFIG_KEXEC 81#ifdef CONFIG_KEXEC
81#include <linux/kexec.h> 82#include <linux/kexec.h>
82 83
83static ssize_t show_crash_notes(struct sys_device *dev, char *buf) 84static ssize_t show_crash_notes(struct sys_device *dev, struct sysdev_attribute *attr,
85 char *buf)
84{ 86{
85 struct cpu *cpu = container_of(dev, struct cpu, sysdev); 87 struct cpu *cpu = container_of(dev, struct cpu, sysdev);
86 ssize_t rc; 88 ssize_t rc;
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 937e8258981d..4d4e0e7b6e92 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -92,7 +92,8 @@ unregister_memory(struct memory_block *memory, struct mem_section *section)
92 * uses. 92 * uses.
93 */ 93 */
94 94
95static ssize_t show_mem_phys_index(struct sys_device *dev, char *buf) 95static ssize_t show_mem_phys_index(struct sys_device *dev,
96 struct sysdev_attribute *attr, char *buf)
96{ 97{
97 struct memory_block *mem = 98 struct memory_block *mem =
98 container_of(dev, struct memory_block, sysdev); 99 container_of(dev, struct memory_block, sysdev);
@@ -102,7 +103,8 @@ static ssize_t show_mem_phys_index(struct sys_device *dev, char *buf)
102/* 103/*
103 * online, offline, going offline, etc. 104 * online, offline, going offline, etc.
104 */ 105 */
105static ssize_t show_mem_state(struct sys_device *dev, char *buf) 106static ssize_t show_mem_state(struct sys_device *dev,
107 struct sysdev_attribute *attr, char *buf)
106{ 108{
107 struct memory_block *mem = 109 struct memory_block *mem =
108 container_of(dev, struct memory_block, sysdev); 110 container_of(dev, struct memory_block, sysdev);
@@ -217,7 +219,8 @@ out:
217} 219}
218 220
219static ssize_t 221static ssize_t
220store_mem_state(struct sys_device *dev, const char *buf, size_t count) 222store_mem_state(struct sys_device *dev,
223 struct sysdev_attribute *attr, const char *buf, size_t count)
221{ 224{
222 struct memory_block *mem; 225 struct memory_block *mem;
223 unsigned int phys_section_nr; 226 unsigned int phys_section_nr;
@@ -248,7 +251,8 @@ out:
248 * s.t. if I offline all of these sections I can then 251 * s.t. if I offline all of these sections I can then
249 * remove the physical device? 252 * remove the physical device?
250 */ 253 */
251static ssize_t show_phys_device(struct sys_device *dev, char *buf) 254static ssize_t show_phys_device(struct sys_device *dev,
255 struct sysdev_attribute *attr, char *buf)
252{ 256{
253 struct memory_block *mem = 257 struct memory_block *mem =
254 container_of(dev, struct memory_block, sysdev); 258 container_of(dev, struct memory_block, sysdev);
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 0f867a083338..5116b78c6325 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -36,11 +36,13 @@ static ssize_t node_read_cpumap(struct sys_device *dev, int type, char *buf)
36 return len; 36 return len;
37} 37}
38 38
39static inline ssize_t node_read_cpumask(struct sys_device *dev, char *buf) 39static inline ssize_t node_read_cpumask(struct sys_device *dev,
40 struct sysdev_attribute *attr, char *buf)
40{ 41{
41 return node_read_cpumap(dev, 0, buf); 42 return node_read_cpumap(dev, 0, buf);
42} 43}
43static inline ssize_t node_read_cpulist(struct sys_device *dev, char *buf) 44static inline ssize_t node_read_cpulist(struct sys_device *dev,
45 struct sysdev_attribute *attr, char *buf)
44{ 46{
45 return node_read_cpumap(dev, 1, buf); 47 return node_read_cpumap(dev, 1, buf);
46} 48}
@@ -49,7 +51,8 @@ static SYSDEV_ATTR(cpumap, S_IRUGO, node_read_cpumask, NULL);
49static SYSDEV_ATTR(cpulist, S_IRUGO, node_read_cpulist, NULL); 51static SYSDEV_ATTR(cpulist, S_IRUGO, node_read_cpulist, NULL);
50 52
51#define K(x) ((x) << (PAGE_SHIFT - 10)) 53#define K(x) ((x) << (PAGE_SHIFT - 10))
52static ssize_t node_read_meminfo(struct sys_device * dev, char * buf) 54static ssize_t node_read_meminfo(struct sys_device * dev,
55 struct sysdev_attribute *attr, char * buf)
53{ 56{
54 int n; 57 int n;
55 int nid = dev->id; 58 int nid = dev->id;
@@ -112,7 +115,8 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf)
112#undef K 115#undef K
113static SYSDEV_ATTR(meminfo, S_IRUGO, node_read_meminfo, NULL); 116static SYSDEV_ATTR(meminfo, S_IRUGO, node_read_meminfo, NULL);
114 117
115static ssize_t node_read_numastat(struct sys_device * dev, char * buf) 118static ssize_t node_read_numastat(struct sys_device * dev,
119 struct sysdev_attribute *attr, char * buf)
116{ 120{
117 return sprintf(buf, 121 return sprintf(buf,
118 "numa_hit %lu\n" 122 "numa_hit %lu\n"
@@ -130,7 +134,8 @@ static ssize_t node_read_numastat(struct sys_device * dev, char * buf)
130} 134}
131static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL); 135static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL);
132 136
133static ssize_t node_read_distance(struct sys_device * dev, char * buf) 137static ssize_t node_read_distance(struct sys_device * dev,
138 struct sysdev_attribute *attr, char * buf)
134{ 139{
135 int nid = dev->id; 140 int nid = dev->id;
136 int len = 0; 141 int len = 0;
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index 50690d9df248..dc7dace14e1c 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -36,7 +36,7 @@ sysdev_show(struct kobject * kobj, struct attribute * attr, char * buffer)
36 struct sysdev_attribute * sysdev_attr = to_sysdev_attr(attr); 36 struct sysdev_attribute * sysdev_attr = to_sysdev_attr(attr);
37 37
38 if (sysdev_attr->show) 38 if (sysdev_attr->show)
39 return sysdev_attr->show(sysdev, buffer); 39 return sysdev_attr->show(sysdev, sysdev_attr, buffer);
40 return -EIO; 40 return -EIO;
41} 41}
42 42
@@ -49,7 +49,7 @@ sysdev_store(struct kobject * kobj, struct attribute * attr,
49 struct sysdev_attribute * sysdev_attr = to_sysdev_attr(attr); 49 struct sysdev_attribute * sysdev_attr = to_sysdev_attr(attr);
50 50
51 if (sysdev_attr->store) 51 if (sysdev_attr->store)
52 return sysdev_attr->store(sysdev, buffer, count); 52 return sysdev_attr->store(sysdev, sysdev_attr, buffer, count);
53 return -EIO; 53 return -EIO;
54} 54}
55 55
diff --git a/drivers/base/topology.c b/drivers/base/topology.c
index 3f6d9b0a6abe..199cd97e32e6 100644
--- a/drivers/base/topology.c
+++ b/drivers/base/topology.c
@@ -34,7 +34,8 @@
34static SYSDEV_ATTR(_name, 0444, show_##_name, NULL) 34static SYSDEV_ATTR(_name, 0444, show_##_name, NULL)
35 35
36#define define_id_show_func(name) \ 36#define define_id_show_func(name) \
37static ssize_t show_##name(struct sys_device *dev, char *buf) \ 37static ssize_t show_##name(struct sys_device *dev, \
38 struct sysdev_attribute *attr, char *buf) \
38{ \ 39{ \
39 unsigned int cpu = dev->id; \ 40 unsigned int cpu = dev->id; \
40 return sprintf(buf, "%d\n", topology_##name(cpu)); \ 41 return sprintf(buf, "%d\n", topology_##name(cpu)); \
@@ -59,14 +60,17 @@ static ssize_t show_cpumap(int type, cpumask_t *mask, char *buf)
59 60
60#ifdef arch_provides_topology_pointers 61#ifdef arch_provides_topology_pointers
61#define define_siblings_show_map(name) \ 62#define define_siblings_show_map(name) \
62static ssize_t show_##name(struct sys_device *dev, char *buf) \ 63static ssize_t show_##name(struct sys_device *dev, \
64 struct sysdev_attribute *attr, char *buf) \
63{ \ 65{ \
64 unsigned int cpu = dev->id; \ 66 unsigned int cpu = dev->id; \
65 return show_cpumap(0, &(topology_##name(cpu)), buf); \ 67 return show_cpumap(0, &(topology_##name(cpu)), buf); \
66} 68}
67 69
68#define define_siblings_show_list(name) \ 70#define define_siblings_show_list(name) \
69static ssize_t show_##name##_list(struct sys_device *dev, char *buf) \ 71static ssize_t show_##name##_list(struct sys_device *dev, \
72 struct sysdev_attribute *attr, \
73 char *buf) \
70{ \ 74{ \
71 unsigned int cpu = dev->id; \ 75 unsigned int cpu = dev->id; \
72 return show_cpumap(1, &(topology_##name(cpu)), buf); \ 76 return show_cpumap(1, &(topology_##name(cpu)), buf); \
@@ -74,7 +78,8 @@ static ssize_t show_##name##_list(struct sys_device *dev, char *buf) \
74 78
75#else 79#else
76#define define_siblings_show_map(name) \ 80#define define_siblings_show_map(name) \
77static ssize_t show_##name(struct sys_device *dev, char *buf) \ 81static ssize_t show_##name(struct sys_device *dev, \
82 struct sysdev_attribute *attr, char *buf) \
78{ \ 83{ \
79 unsigned int cpu = dev->id; \ 84 unsigned int cpu = dev->id; \
80 cpumask_t mask = topology_##name(cpu); \ 85 cpumask_t mask = topology_##name(cpu); \
@@ -82,7 +87,9 @@ static ssize_t show_##name(struct sys_device *dev, char *buf) \
82} 87}
83 88
84#define define_siblings_show_list(name) \ 89#define define_siblings_show_list(name) \
85static ssize_t show_##name##_list(struct sys_device *dev, char *buf) \ 90static ssize_t show_##name##_list(struct sys_device *dev, \
91 struct sysdev_attribute *attr, \
92 char *buf) \
86{ \ 93{ \
87 unsigned int cpu = dev->id; \ 94 unsigned int cpu = dev->id; \
88 cpumask_t mask = topology_##name(cpu); \ 95 cpumask_t mask = topology_##name(cpu); \
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
index e949618b9be0..31a0e0b455b6 100644
--- a/drivers/cpuidle/sysfs.c
+++ b/drivers/cpuidle/sysfs.c
@@ -21,7 +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
24static ssize_t show_available_governors(struct sys_device *dev, char *buf) 24static ssize_t show_available_governors(struct sys_device *dev,
25 struct sysdev_attribute *attr, char *buf)
25{ 26{
26 ssize_t i = 0; 27 ssize_t i = 0;
27 struct cpuidle_governor *tmp; 28 struct cpuidle_governor *tmp;
@@ -39,7 +40,8 @@ out:
39 return i; 40 return i;
40} 41}
41 42
42static ssize_t show_current_driver(struct sys_device *dev, char *buf) 43static ssize_t show_current_driver(struct sys_device *dev,
44 struct sysdev_attribute *attr, char *buf)
43{ 45{
44 ssize_t ret; 46 ssize_t ret;
45 47
@@ -53,7 +55,8 @@ static ssize_t show_current_driver(struct sys_device *dev, char *buf)
53 return ret; 55 return ret;
54} 56}
55 57
56static ssize_t show_current_governor(struct sys_device *dev, char *buf) 58static ssize_t show_current_governor(struct sys_device *dev,
59 struct sysdev_attribute *attr, char *buf)
57{ 60{
58 ssize_t ret; 61 ssize_t ret;
59 62
@@ -68,6 +71,7 @@ static ssize_t show_current_governor(struct sys_device *dev, char *buf)
68} 71}
69 72
70static ssize_t store_current_governor(struct sys_device *dev, 73static ssize_t store_current_governor(struct sys_device *dev,
74 struct sysdev_attribute *attr,
71 const char *buf, size_t count) 75 const char *buf, size_t count)
72{ 76{
73 char gov_name[CPUIDLE_NAME_LEN]; 77 char gov_name[CPUIDLE_NAME_LEN];
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 591bc29b55f5..d4427cb86979 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -610,6 +610,7 @@ static ssize_t show_target_kb(struct sys_device *dev, char *buf)
610} 610}
611 611
612static ssize_t store_target_kb(struct sys_device *dev, 612static ssize_t store_target_kb(struct sys_device *dev,
613 struct sysdev_attribute *attr,
613 const char *buf, 614 const char *buf,
614 size_t count) 615 size_t count)
615{ 616{
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index f2767bc6b735..8dcf3162b21b 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -99,8 +99,9 @@ extern void sysdev_unregister(struct sys_device *);
99 99
100struct sysdev_attribute { 100struct sysdev_attribute {
101 struct attribute attr; 101 struct attribute attr;
102 ssize_t (*show)(struct sys_device *, char *); 102 ssize_t (*show)(struct sys_device *, struct sysdev_attribute *, char *);
103 ssize_t (*store)(struct sys_device *, const char *, size_t); 103 ssize_t (*store)(struct sys_device *, struct sysdev_attribute *,
104 const char *, size_t);
104}; 105};
105 106
106 107
diff --git a/kernel/rtmutex-tester.c b/kernel/rtmutex-tester.c
index 092e4c620af9..a56f629b057a 100644
--- a/kernel/rtmutex-tester.c
+++ b/kernel/rtmutex-tester.c
@@ -297,8 +297,8 @@ static int test_func(void *data)
297 * 297 *
298 * opcode:data 298 * opcode:data
299 */ 299 */
300static ssize_t sysfs_test_command(struct sys_device *dev, const char *buf, 300static ssize_t sysfs_test_command(struct sys_device *dev, struct sysdev_attribute *attr,
301 size_t count) 301 const char *buf, size_t count)
302{ 302{
303 struct sched_param schedpar; 303 struct sched_param schedpar;
304 struct test_thread_data *td; 304 struct test_thread_data *td;
@@ -360,7 +360,8 @@ static ssize_t sysfs_test_command(struct sys_device *dev, const char *buf,
360 * @dev: thread to query 360 * @dev: thread to query
361 * @buf: char buffer to be filled with thread status info 361 * @buf: char buffer to be filled with thread status info
362 */ 362 */
363static ssize_t sysfs_test_status(struct sys_device *dev, char *buf) 363static ssize_t sysfs_test_status(struct sys_device *dev, struct sysdev_attribute *attr,
364 char *buf)
364{ 365{
365 struct test_thread_data *td; 366 struct test_thread_data *td;
366 struct task_struct *tsk; 367 struct task_struct *tsk;
diff --git a/kernel/sched.c b/kernel/sched.c
index 99e6d850ecab..b1104ea5d255 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -7737,11 +7737,13 @@ static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt)
7737} 7737}
7738 7738
7739#ifdef CONFIG_SCHED_MC 7739#ifdef CONFIG_SCHED_MC
7740static ssize_t sched_mc_power_savings_show(struct sys_device *dev, char *page) 7740static ssize_t sched_mc_power_savings_show(struct sys_device *dev,
7741 struct sysdev_attribute *attr, char *page)
7741{ 7742{
7742 return sprintf(page, "%u\n", sched_mc_power_savings); 7743 return sprintf(page, "%u\n", sched_mc_power_savings);
7743} 7744}
7744static ssize_t sched_mc_power_savings_store(struct sys_device *dev, 7745static ssize_t sched_mc_power_savings_store(struct sys_device *dev,
7746 struct sysdev_attribute *attr,
7745 const char *buf, size_t count) 7747 const char *buf, size_t count)
7746{ 7748{
7747 return sched_power_savings_store(buf, count, 0); 7749 return sched_power_savings_store(buf, count, 0);
@@ -7751,11 +7753,13 @@ static SYSDEV_ATTR(sched_mc_power_savings, 0644, sched_mc_power_savings_show,
7751#endif 7753#endif
7752 7754
7753#ifdef CONFIG_SCHED_SMT 7755#ifdef CONFIG_SCHED_SMT
7754static ssize_t sched_smt_power_savings_show(struct sys_device *dev, char *page) 7756static ssize_t sched_smt_power_savings_show(struct sys_device *dev,
7757 struct sysdev_attribute *attr, char *page)
7755{ 7758{
7756 return sprintf(page, "%u\n", sched_smt_power_savings); 7759 return sprintf(page, "%u\n", sched_smt_power_savings);
7757} 7760}
7758static ssize_t sched_smt_power_savings_store(struct sys_device *dev, 7761static ssize_t sched_smt_power_savings_store(struct sys_device *dev,
7762 struct sysdev_attribute *attr,
7759 const char *buf, size_t count) 7763 const char *buf, size_t count)
7760{ 7764{
7761 return sched_power_savings_store(buf, count, 1); 7765 return sched_power_savings_store(buf, count, 1);
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index dadde5361f32..b1c2da81b050 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -376,7 +376,8 @@ void clocksource_unregister(struct clocksource *cs)
376 * Provides sysfs interface for listing current clocksource. 376 * Provides sysfs interface for listing current clocksource.
377 */ 377 */
378static ssize_t 378static ssize_t
379sysfs_show_current_clocksources(struct sys_device *dev, char *buf) 379sysfs_show_current_clocksources(struct sys_device *dev,
380 struct sysdev_attribute *attr, char *buf)
380{ 381{
381 ssize_t count = 0; 382 ssize_t count = 0;
382 383
@@ -397,6 +398,7 @@ sysfs_show_current_clocksources(struct sys_device *dev, char *buf)
397 * clocksource selction. 398 * clocksource selction.
398 */ 399 */
399static ssize_t sysfs_override_clocksource(struct sys_device *dev, 400static ssize_t sysfs_override_clocksource(struct sys_device *dev,
401 struct sysdev_attribute *attr,
400 const char *buf, size_t count) 402 const char *buf, size_t count)
401{ 403{
402 struct clocksource *ovr = NULL; 404 struct clocksource *ovr = NULL;
@@ -449,7 +451,9 @@ static ssize_t sysfs_override_clocksource(struct sys_device *dev,
449 * Provides sysfs interface for listing registered clocksources 451 * Provides sysfs interface for listing registered clocksources
450 */ 452 */
451static ssize_t 453static ssize_t
452sysfs_show_available_clocksources(struct sys_device *dev, char *buf) 454sysfs_show_available_clocksources(struct sys_device *dev,
455 struct sysdev_attribute *attr,
456 char *buf)
453{ 457{
454 struct clocksource *src; 458 struct clocksource *src;
455 ssize_t count = 0; 459 ssize_t count = 0;