diff options
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/core.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 4dbfd04a2148..2a4590fabcad 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -6675,54 +6675,52 @@ static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt) | |||
6675 | } | 6675 | } |
6676 | 6676 | ||
6677 | #ifdef CONFIG_SCHED_MC | 6677 | #ifdef CONFIG_SCHED_MC |
6678 | static ssize_t sched_mc_power_savings_show(struct sysdev_class *class, | 6678 | static ssize_t sched_mc_power_savings_show(struct device *dev, |
6679 | struct sysdev_class_attribute *attr, | 6679 | struct device_attribute *attr, |
6680 | char *page) | 6680 | char *buf) |
6681 | { | 6681 | { |
6682 | return sprintf(page, "%u\n", sched_mc_power_savings); | 6682 | return sprintf(buf, "%u\n", sched_mc_power_savings); |
6683 | } | 6683 | } |
6684 | static ssize_t sched_mc_power_savings_store(struct sysdev_class *class, | 6684 | static ssize_t sched_mc_power_savings_store(struct device *dev, |
6685 | struct sysdev_class_attribute *attr, | 6685 | struct device_attribute *attr, |
6686 | const char *buf, size_t count) | 6686 | const char *buf, size_t count) |
6687 | { | 6687 | { |
6688 | return sched_power_savings_store(buf, count, 0); | 6688 | return sched_power_savings_store(buf, count, 0); |
6689 | } | 6689 | } |
6690 | static SYSDEV_CLASS_ATTR(sched_mc_power_savings, 0644, | 6690 | static DEVICE_ATTR(sched_mc_power_savings, 0644, |
6691 | sched_mc_power_savings_show, | 6691 | sched_mc_power_savings_show, |
6692 | sched_mc_power_savings_store); | 6692 | sched_mc_power_savings_store); |
6693 | #endif | 6693 | #endif |
6694 | 6694 | ||
6695 | #ifdef CONFIG_SCHED_SMT | 6695 | #ifdef CONFIG_SCHED_SMT |
6696 | static ssize_t sched_smt_power_savings_show(struct sysdev_class *dev, | 6696 | static ssize_t sched_smt_power_savings_show(struct device *dev, |
6697 | struct sysdev_class_attribute *attr, | 6697 | struct device_attribute *attr, |
6698 | char *page) | 6698 | char *buf) |
6699 | { | 6699 | { |
6700 | return sprintf(page, "%u\n", sched_smt_power_savings); | 6700 | return sprintf(buf, "%u\n", sched_smt_power_savings); |
6701 | } | 6701 | } |
6702 | static ssize_t sched_smt_power_savings_store(struct sysdev_class *dev, | 6702 | static ssize_t sched_smt_power_savings_store(struct device *dev, |
6703 | struct sysdev_class_attribute *attr, | 6703 | struct device_attribute *attr, |
6704 | const char *buf, size_t count) | 6704 | const char *buf, size_t count) |
6705 | { | 6705 | { |
6706 | return sched_power_savings_store(buf, count, 1); | 6706 | return sched_power_savings_store(buf, count, 1); |
6707 | } | 6707 | } |
6708 | static SYSDEV_CLASS_ATTR(sched_smt_power_savings, 0644, | 6708 | static DEVICE_ATTR(sched_smt_power_savings, 0644, |
6709 | sched_smt_power_savings_show, | 6709 | sched_smt_power_savings_show, |
6710 | sched_smt_power_savings_store); | 6710 | sched_smt_power_savings_store); |
6711 | #endif | 6711 | #endif |
6712 | 6712 | ||
6713 | int __init sched_create_sysfs_power_savings_entries(struct sysdev_class *cls) | 6713 | int __init sched_create_sysfs_power_savings_entries(struct device *dev) |
6714 | { | 6714 | { |
6715 | int err = 0; | 6715 | int err = 0; |
6716 | 6716 | ||
6717 | #ifdef CONFIG_SCHED_SMT | 6717 | #ifdef CONFIG_SCHED_SMT |
6718 | if (smt_capable()) | 6718 | if (smt_capable()) |
6719 | err = sysfs_create_file(&cls->kset.kobj, | 6719 | err = device_create_file(dev, &dev_attr_sched_smt_power_savings); |
6720 | &attr_sched_smt_power_savings.attr); | ||
6721 | #endif | 6720 | #endif |
6722 | #ifdef CONFIG_SCHED_MC | 6721 | #ifdef CONFIG_SCHED_MC |
6723 | if (!err && mc_capable()) | 6722 | if (!err && mc_capable()) |
6724 | err = sysfs_create_file(&cls->kset.kobj, | 6723 | err = device_create_file(dev, &dev_attr_sched_mc_power_savings); |
6725 | &attr_sched_mc_power_savings.attr); | ||
6726 | #endif | 6724 | #endif |
6727 | return err; | 6725 | return err; |
6728 | } | 6726 | } |