aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
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 /kernel
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 'kernel')
-rw-r--r--kernel/sched.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 0e9344a71be3..530772646443 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -7923,54 +7923,52 @@ static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt)
7923} 7923}
7924 7924
7925#ifdef CONFIG_SCHED_MC 7925#ifdef CONFIG_SCHED_MC
7926static ssize_t sched_mc_power_savings_show(struct sysdev_class *class, 7926static ssize_t sched_mc_power_savings_show(struct device *dev,
7927 struct sysdev_class_attribute *attr, 7927 struct device_attribute *attr,
7928 char *page) 7928 char *buf)
7929{ 7929{
7930 return sprintf(page, "%u\n", sched_mc_power_savings); 7930 return sprintf(buf, "%u\n", sched_mc_power_savings);
7931} 7931}
7932static ssize_t sched_mc_power_savings_store(struct sysdev_class *class, 7932static ssize_t sched_mc_power_savings_store(struct device *dev,
7933 struct sysdev_class_attribute *attr, 7933 struct device_attribute *attr,
7934 const char *buf, size_t count) 7934 const char *buf, size_t count)
7935{ 7935{
7936 return sched_power_savings_store(buf, count, 0); 7936 return sched_power_savings_store(buf, count, 0);
7937} 7937}
7938static SYSDEV_CLASS_ATTR(sched_mc_power_savings, 0644, 7938static DEVICE_ATTR(sched_mc_power_savings, 0644,
7939 sched_mc_power_savings_show, 7939 sched_mc_power_savings_show,
7940 sched_mc_power_savings_store); 7940 sched_mc_power_savings_store);
7941#endif 7941#endif
7942 7942
7943#ifdef CONFIG_SCHED_SMT 7943#ifdef CONFIG_SCHED_SMT
7944static ssize_t sched_smt_power_savings_show(struct sysdev_class *dev, 7944static ssize_t sched_smt_power_savings_show(struct device *dev,
7945 struct sysdev_class_attribute *attr, 7945 struct device_attribute *attr,
7946 char *page) 7946 char *buf)
7947{ 7947{
7948 return sprintf(page, "%u\n", sched_smt_power_savings); 7948 return sprintf(buf, "%u\n", sched_smt_power_savings);
7949} 7949}
7950static ssize_t sched_smt_power_savings_store(struct sysdev_class *dev, 7950static ssize_t sched_smt_power_savings_store(struct device *dev,
7951 struct sysdev_class_attribute *attr, 7951 struct device_attribute *attr,
7952 const char *buf, size_t count) 7952 const char *buf, size_t count)
7953{ 7953{
7954 return sched_power_savings_store(buf, count, 1); 7954 return sched_power_savings_store(buf, count, 1);
7955} 7955}
7956static SYSDEV_CLASS_ATTR(sched_smt_power_savings, 0644, 7956static DEVICE_ATTR(sched_smt_power_savings, 0644,
7957 sched_smt_power_savings_show, 7957 sched_smt_power_savings_show,
7958 sched_smt_power_savings_store); 7958 sched_smt_power_savings_store);
7959#endif 7959#endif
7960 7960
7961int __init sched_create_sysfs_power_savings_entries(struct sysdev_class *cls) 7961int __init sched_create_sysfs_power_savings_entries(struct device *dev)
7962{ 7962{
7963 int err = 0; 7963 int err = 0;
7964 7964
7965#ifdef CONFIG_SCHED_SMT 7965#ifdef CONFIG_SCHED_SMT
7966 if (smt_capable()) 7966 if (smt_capable())
7967 err = sysfs_create_file(&cls->kset.kobj, 7967 err = device_create_file(dev, &dev_attr_sched_smt_power_savings);
7968 &attr_sched_smt_power_savings.attr);
7969#endif 7968#endif
7970#ifdef CONFIG_SCHED_MC 7969#ifdef CONFIG_SCHED_MC
7971 if (!err && mc_capable()) 7970 if (!err && mc_capable())
7972 err = sysfs_create_file(&cls->kset.kobj, 7971 err = device_create_file(dev, &dev_attr_sched_mc_power_savings);
7973 &attr_sched_mc_power_savings.attr);
7974#endif 7972#endif
7975 return err; 7973 return err;
7976} 7974}