diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2011-12-21 17:29:42 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-12-21 17:29:42 -0500 |
commit | 8a25a2fd126c621f44f3aeaef80d51f00fc11639 (patch) | |
tree | 41694ab1a9c82a7a02d9cd33c929fd039c98c815 /arch/sh/kernel | |
parent | cb0c05c5fae12eeb7c85c205578df277bd706155 (diff) |
cpu: convert 'cpu' and 'machinecheck' sysdev_class to a regular subsystem
This moves the 'cpu sysdev_class' over to a regular 'cpu' subsystem
and converts the devices to regular devices. The sysdev drivers are
implemented as subsystem interfaces now.
After all sysdev classes are ported to regular driver core entities, the
sysdev implementation will be entirely removed from the kernel.
Userspace relies on events and generic sysfs subsystem infrastructure
from sysdev devices, which are made available with this conversion.
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Borislav Petkov <bp@amd64.org>
Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
Cc: Len Brown <lenb@kernel.org>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Dave Jones <davej@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r-- | arch/sh/kernel/cpu/sh4/sq.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c index f0907995b4c9..a8140f0bbf6c 100644 --- a/arch/sh/kernel/cpu/sh4/sq.c +++ b/arch/sh/kernel/cpu/sh4/sq.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/cpu.h> | 14 | #include <linux/cpu.h> |
15 | #include <linux/bitmap.h> | 15 | #include <linux/bitmap.h> |
16 | #include <linux/sysdev.h> | 16 | #include <linux/device.h> |
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
@@ -337,9 +337,9 @@ static struct kobj_type ktype_percpu_entry = { | |||
337 | .default_attrs = sq_sysfs_attrs, | 337 | .default_attrs = sq_sysfs_attrs, |
338 | }; | 338 | }; |
339 | 339 | ||
340 | static int __devinit sq_sysdev_add(struct sys_device *sysdev) | 340 | static int __devinit sq_dev_add(struct device *dev) |
341 | { | 341 | { |
342 | unsigned int cpu = sysdev->id; | 342 | unsigned int cpu = dev->id; |
343 | struct kobject *kobj; | 343 | struct kobject *kobj; |
344 | int error; | 344 | int error; |
345 | 345 | ||
@@ -348,25 +348,27 @@ static int __devinit sq_sysdev_add(struct sys_device *sysdev) | |||
348 | return -ENOMEM; | 348 | return -ENOMEM; |
349 | 349 | ||
350 | kobj = sq_kobject[cpu]; | 350 | kobj = sq_kobject[cpu]; |
351 | error = kobject_init_and_add(kobj, &ktype_percpu_entry, &sysdev->kobj, | 351 | error = kobject_init_and_add(kobj, &ktype_percpu_entry, &dev->kobj, |
352 | "%s", "sq"); | 352 | "%s", "sq"); |
353 | if (!error) | 353 | if (!error) |
354 | kobject_uevent(kobj, KOBJ_ADD); | 354 | kobject_uevent(kobj, KOBJ_ADD); |
355 | return error; | 355 | return error; |
356 | } | 356 | } |
357 | 357 | ||
358 | static int __devexit sq_sysdev_remove(struct sys_device *sysdev) | 358 | static int __devexit sq_dev_remove(struct device *dev) |
359 | { | 359 | { |
360 | unsigned int cpu = sysdev->id; | 360 | unsigned int cpu = dev->id; |
361 | struct kobject *kobj = sq_kobject[cpu]; | 361 | struct kobject *kobj = sq_kobject[cpu]; |
362 | 362 | ||
363 | kobject_put(kobj); | 363 | kobject_put(kobj); |
364 | return 0; | 364 | return 0; |
365 | } | 365 | } |
366 | 366 | ||
367 | static struct sysdev_driver sq_sysdev_driver = { | 367 | static struct subsys_interface sq_interface = { |
368 | .add = sq_sysdev_add, | 368 | .name = "sq" |
369 | .remove = __devexit_p(sq_sysdev_remove), | 369 | .subsys = &cpu_subsys, |
370 | .add_dev = sq_dev_add, | ||
371 | .remove_dev = __devexit_p(sq_dev_remove), | ||
370 | }; | 372 | }; |
371 | 373 | ||
372 | static int __init sq_api_init(void) | 374 | static int __init sq_api_init(void) |
@@ -386,7 +388,7 @@ static int __init sq_api_init(void) | |||
386 | if (unlikely(!sq_bitmap)) | 388 | if (unlikely(!sq_bitmap)) |
387 | goto out; | 389 | goto out; |
388 | 390 | ||
389 | ret = sysdev_driver_register(&cpu_sysdev_class, &sq_sysdev_driver); | 391 | ret = subsys_interface_register(&sq_interface); |
390 | if (unlikely(ret != 0)) | 392 | if (unlikely(ret != 0)) |
391 | goto out; | 393 | goto out; |
392 | 394 | ||
@@ -401,7 +403,7 @@ out: | |||
401 | 403 | ||
402 | static void __exit sq_api_exit(void) | 404 | static void __exit sq_api_exit(void) |
403 | { | 405 | { |
404 | sysdev_driver_unregister(&cpu_sysdev_class, &sq_sysdev_driver); | 406 | subsys_interface_unregister(&sq_interface); |
405 | kfree(sq_bitmap); | 407 | kfree(sq_bitmap); |
406 | kmem_cache_destroy(sq_cache); | 408 | kmem_cache_destroy(sq_cache); |
407 | } | 409 | } |