aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle/cpuidle.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-12-21 17:29:42 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-12-21 17:29:42 -0500
commit8a25a2fd126c621f44f3aeaef80d51f00fc11639 (patch)
tree41694ab1a9c82a7a02d9cd33c929fd039c98c815 /drivers/cpuidle/cpuidle.c
parentcb0c05c5fae12eeb7c85c205578df277bd706155 (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 'drivers/cpuidle/cpuidle.c')
-rw-r--r--drivers/cpuidle/cpuidle.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index 06ce2680d00d..59f4261c753a 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -291,10 +291,10 @@ EXPORT_SYMBOL_GPL(cpuidle_disable_device);
291static int __cpuidle_register_device(struct cpuidle_device *dev) 291static int __cpuidle_register_device(struct cpuidle_device *dev)
292{ 292{
293 int ret; 293 int ret;
294 struct sys_device *sys_dev = get_cpu_sysdev((unsigned long)dev->cpu); 294 struct device *cpu_dev = get_cpu_device((unsigned long)dev->cpu);
295 struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver(); 295 struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver();
296 296
297 if (!sys_dev) 297 if (!dev)
298 return -EINVAL; 298 return -EINVAL;
299 if (!try_module_get(cpuidle_driver->owner)) 299 if (!try_module_get(cpuidle_driver->owner))
300 return -EINVAL; 300 return -EINVAL;
@@ -303,7 +303,7 @@ static int __cpuidle_register_device(struct cpuidle_device *dev)
303 303
304 per_cpu(cpuidle_devices, dev->cpu) = dev; 304 per_cpu(cpuidle_devices, dev->cpu) = dev;
305 list_add(&dev->device_list, &cpuidle_detected_devices); 305 list_add(&dev->device_list, &cpuidle_detected_devices);
306 if ((ret = cpuidle_add_sysfs(sys_dev))) { 306 if ((ret = cpuidle_add_sysfs(cpu_dev))) {
307 module_put(cpuidle_driver->owner); 307 module_put(cpuidle_driver->owner);
308 return ret; 308 return ret;
309 } 309 }
@@ -344,7 +344,7 @@ EXPORT_SYMBOL_GPL(cpuidle_register_device);
344 */ 344 */
345void cpuidle_unregister_device(struct cpuidle_device *dev) 345void cpuidle_unregister_device(struct cpuidle_device *dev)
346{ 346{
347 struct sys_device *sys_dev = get_cpu_sysdev((unsigned long)dev->cpu); 347 struct device *cpu_dev = get_cpu_device((unsigned long)dev->cpu);
348 struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver(); 348 struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver();
349 349
350 if (dev->registered == 0) 350 if (dev->registered == 0)
@@ -354,7 +354,7 @@ void cpuidle_unregister_device(struct cpuidle_device *dev)
354 354
355 cpuidle_disable_device(dev); 355 cpuidle_disable_device(dev);
356 356
357 cpuidle_remove_sysfs(sys_dev); 357 cpuidle_remove_sysfs(cpu_dev);
358 list_del(&dev->device_list); 358 list_del(&dev->device_list);
359 wait_for_completion(&dev->kobj_unregister); 359 wait_for_completion(&dev->kobj_unregister);
360 per_cpu(cpuidle_devices, dev->cpu) = NULL; 360 per_cpu(cpuidle_devices, dev->cpu) = NULL;
@@ -411,7 +411,7 @@ static int __init cpuidle_init(void)
411 if (cpuidle_disabled()) 411 if (cpuidle_disabled())
412 return -ENODEV; 412 return -ENODEV;
413 413
414 ret = cpuidle_add_class_sysfs(&cpu_sysdev_class); 414 ret = cpuidle_add_interface(cpu_subsys.dev_root);
415 if (ret) 415 if (ret)
416 return ret; 416 return ret;
417 417