diff options
author | gregkh@suse.de <gregkh@suse.de> | 2005-03-23 12:56:34 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-20 18:15:09 -0400 |
commit | 8874b414ffe037c39e73bb262ddf69653a13c0a4 (patch) | |
tree | d7a7b021ab3b4319cc65f1b4fd2f76eb757dfb69 /arch/i386/kernel | |
parent | d253878b3d9ae523c76118f5336a662780ad3757 (diff) |
[PATCH] class: convert arch/* to use the new class api instead of class_simple
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/i386/kernel')
-rw-r--r-- | arch/i386/kernel/cpuid.c | 22 | ||||
-rw-r--r-- | arch/i386/kernel/msr.c | 22 |
2 files changed, 22 insertions, 22 deletions
diff --git a/arch/i386/kernel/cpuid.c b/arch/i386/kernel/cpuid.c index 2e2756345bb2..4647db4ad6de 100644 --- a/arch/i386/kernel/cpuid.c +++ b/arch/i386/kernel/cpuid.c | |||
@@ -45,7 +45,7 @@ | |||
45 | #include <asm/uaccess.h> | 45 | #include <asm/uaccess.h> |
46 | #include <asm/system.h> | 46 | #include <asm/system.h> |
47 | 47 | ||
48 | static struct class_simple *cpuid_class; | 48 | static struct class *cpuid_class; |
49 | 49 | ||
50 | #ifdef CONFIG_SMP | 50 | #ifdef CONFIG_SMP |
51 | 51 | ||
@@ -158,12 +158,12 @@ static struct file_operations cpuid_fops = { | |||
158 | .open = cpuid_open, | 158 | .open = cpuid_open, |
159 | }; | 159 | }; |
160 | 160 | ||
161 | static int cpuid_class_simple_device_add(int i) | 161 | static int cpuid_class_device_create(int i) |
162 | { | 162 | { |
163 | int err = 0; | 163 | int err = 0; |
164 | struct class_device *class_err; | 164 | struct class_device *class_err; |
165 | 165 | ||
166 | class_err = class_simple_device_add(cpuid_class, MKDEV(CPUID_MAJOR, i), NULL, "cpu%d",i); | 166 | class_err = class_device_create(cpuid_class, MKDEV(CPUID_MAJOR, i), NULL, "cpu%d",i); |
167 | if (IS_ERR(class_err)) | 167 | if (IS_ERR(class_err)) |
168 | err = PTR_ERR(class_err); | 168 | err = PTR_ERR(class_err); |
169 | return err; | 169 | return err; |
@@ -175,10 +175,10 @@ static int __devinit cpuid_class_cpu_callback(struct notifier_block *nfb, unsign | |||
175 | 175 | ||
176 | switch (action) { | 176 | switch (action) { |
177 | case CPU_ONLINE: | 177 | case CPU_ONLINE: |
178 | cpuid_class_simple_device_add(cpu); | 178 | cpuid_class_device_create(cpu); |
179 | break; | 179 | break; |
180 | case CPU_DEAD: | 180 | case CPU_DEAD: |
181 | class_simple_device_remove(MKDEV(CPUID_MAJOR, cpu)); | 181 | class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, cpu)); |
182 | break; | 182 | break; |
183 | } | 183 | } |
184 | return NOTIFY_OK; | 184 | return NOTIFY_OK; |
@@ -200,13 +200,13 @@ static int __init cpuid_init(void) | |||
200 | err = -EBUSY; | 200 | err = -EBUSY; |
201 | goto out; | 201 | goto out; |
202 | } | 202 | } |
203 | cpuid_class = class_simple_create(THIS_MODULE, "cpuid"); | 203 | cpuid_class = class_create(THIS_MODULE, "cpuid"); |
204 | if (IS_ERR(cpuid_class)) { | 204 | if (IS_ERR(cpuid_class)) { |
205 | err = PTR_ERR(cpuid_class); | 205 | err = PTR_ERR(cpuid_class); |
206 | goto out_chrdev; | 206 | goto out_chrdev; |
207 | } | 207 | } |
208 | for_each_online_cpu(i) { | 208 | for_each_online_cpu(i) { |
209 | err = cpuid_class_simple_device_add(i); | 209 | err = cpuid_class_device_create(i); |
210 | if (err != 0) | 210 | if (err != 0) |
211 | goto out_class; | 211 | goto out_class; |
212 | } | 212 | } |
@@ -218,9 +218,9 @@ static int __init cpuid_init(void) | |||
218 | out_class: | 218 | out_class: |
219 | i = 0; | 219 | i = 0; |
220 | for_each_online_cpu(i) { | 220 | for_each_online_cpu(i) { |
221 | class_simple_device_remove(MKDEV(CPUID_MAJOR, i)); | 221 | class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, i)); |
222 | } | 222 | } |
223 | class_simple_destroy(cpuid_class); | 223 | class_destroy(cpuid_class); |
224 | out_chrdev: | 224 | out_chrdev: |
225 | unregister_chrdev(CPUID_MAJOR, "cpu/cpuid"); | 225 | unregister_chrdev(CPUID_MAJOR, "cpu/cpuid"); |
226 | out: | 226 | out: |
@@ -232,8 +232,8 @@ static void __exit cpuid_exit(void) | |||
232 | int cpu = 0; | 232 | int cpu = 0; |
233 | 233 | ||
234 | for_each_online_cpu(cpu) | 234 | for_each_online_cpu(cpu) |
235 | class_simple_device_remove(MKDEV(CPUID_MAJOR, cpu)); | 235 | class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, cpu)); |
236 | class_simple_destroy(cpuid_class); | 236 | class_destroy(cpuid_class); |
237 | unregister_chrdev(CPUID_MAJOR, "cpu/cpuid"); | 237 | unregister_chrdev(CPUID_MAJOR, "cpu/cpuid"); |
238 | unregister_cpu_notifier(&cpuid_class_cpu_notifier); | 238 | unregister_cpu_notifier(&cpuid_class_cpu_notifier); |
239 | } | 239 | } |
diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c index 05d9f8f363a6..b2f03c39a6fe 100644 --- a/arch/i386/kernel/msr.c +++ b/arch/i386/kernel/msr.c | |||
@@ -44,7 +44,7 @@ | |||
44 | #include <asm/uaccess.h> | 44 | #include <asm/uaccess.h> |
45 | #include <asm/system.h> | 45 | #include <asm/system.h> |
46 | 46 | ||
47 | static struct class_simple *msr_class; | 47 | static struct class *msr_class; |
48 | 48 | ||
49 | /* Note: "err" is handled in a funny way below. Otherwise one version | 49 | /* Note: "err" is handled in a funny way below. Otherwise one version |
50 | of gcc or another breaks. */ | 50 | of gcc or another breaks. */ |
@@ -260,12 +260,12 @@ static struct file_operations msr_fops = { | |||
260 | .open = msr_open, | 260 | .open = msr_open, |
261 | }; | 261 | }; |
262 | 262 | ||
263 | static int msr_class_simple_device_add(int i) | 263 | static int msr_class_device_create(int i) |
264 | { | 264 | { |
265 | int err = 0; | 265 | int err = 0; |
266 | struct class_device *class_err; | 266 | struct class_device *class_err; |
267 | 267 | ||
268 | class_err = class_simple_device_add(msr_class, MKDEV(MSR_MAJOR, i), NULL, "msr%d",i); | 268 | class_err = class_device_create(msr_class, MKDEV(MSR_MAJOR, i), NULL, "msr%d",i); |
269 | if (IS_ERR(class_err)) | 269 | if (IS_ERR(class_err)) |
270 | err = PTR_ERR(class_err); | 270 | err = PTR_ERR(class_err); |
271 | return err; | 271 | return err; |
@@ -277,10 +277,10 @@ static int __devinit msr_class_cpu_callback(struct notifier_block *nfb, unsigned | |||
277 | 277 | ||
278 | switch (action) { | 278 | switch (action) { |
279 | case CPU_ONLINE: | 279 | case CPU_ONLINE: |
280 | msr_class_simple_device_add(cpu); | 280 | msr_class_device_create(cpu); |
281 | break; | 281 | break; |
282 | case CPU_DEAD: | 282 | case CPU_DEAD: |
283 | class_simple_device_remove(MKDEV(MSR_MAJOR, cpu)); | 283 | class_device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu)); |
284 | break; | 284 | break; |
285 | } | 285 | } |
286 | return NOTIFY_OK; | 286 | return NOTIFY_OK; |
@@ -302,13 +302,13 @@ static int __init msr_init(void) | |||
302 | err = -EBUSY; | 302 | err = -EBUSY; |
303 | goto out; | 303 | goto out; |
304 | } | 304 | } |
305 | msr_class = class_simple_create(THIS_MODULE, "msr"); | 305 | msr_class = class_create(THIS_MODULE, "msr"); |
306 | if (IS_ERR(msr_class)) { | 306 | if (IS_ERR(msr_class)) { |
307 | err = PTR_ERR(msr_class); | 307 | err = PTR_ERR(msr_class); |
308 | goto out_chrdev; | 308 | goto out_chrdev; |
309 | } | 309 | } |
310 | for_each_online_cpu(i) { | 310 | for_each_online_cpu(i) { |
311 | err = msr_class_simple_device_add(i); | 311 | err = msr_class_device_create(i); |
312 | if (err != 0) | 312 | if (err != 0) |
313 | goto out_class; | 313 | goto out_class; |
314 | } | 314 | } |
@@ -320,8 +320,8 @@ static int __init msr_init(void) | |||
320 | out_class: | 320 | out_class: |
321 | i = 0; | 321 | i = 0; |
322 | for_each_online_cpu(i) | 322 | for_each_online_cpu(i) |
323 | class_simple_device_remove(MKDEV(MSR_MAJOR, i)); | 323 | class_device_destroy(msr_class, MKDEV(MSR_MAJOR, i)); |
324 | class_simple_destroy(msr_class); | 324 | class_destroy(msr_class); |
325 | out_chrdev: | 325 | out_chrdev: |
326 | unregister_chrdev(MSR_MAJOR, "cpu/msr"); | 326 | unregister_chrdev(MSR_MAJOR, "cpu/msr"); |
327 | out: | 327 | out: |
@@ -332,8 +332,8 @@ static void __exit msr_exit(void) | |||
332 | { | 332 | { |
333 | int cpu = 0; | 333 | int cpu = 0; |
334 | for_each_online_cpu(cpu) | 334 | for_each_online_cpu(cpu) |
335 | class_simple_device_remove(MKDEV(MSR_MAJOR, cpu)); | 335 | class_device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu)); |
336 | class_simple_destroy(msr_class); | 336 | class_destroy(msr_class); |
337 | unregister_chrdev(MSR_MAJOR, "cpu/msr"); | 337 | unregister_chrdev(MSR_MAJOR, "cpu/msr"); |
338 | unregister_cpu_notifier(&msr_class_cpu_notifier); | 338 | unregister_cpu_notifier(&msr_class_cpu_notifier); |
339 | } | 339 | } |