diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index d6b149ccf925..a7f381a78469 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -7940,54 +7940,52 @@ static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt) | |||
7940 | } | 7940 | } |
7941 | 7941 | ||
7942 | #ifdef CONFIG_SCHED_MC | 7942 | #ifdef CONFIG_SCHED_MC |
7943 | static ssize_t sched_mc_power_savings_show(struct sysdev_class *class, | 7943 | static ssize_t sched_mc_power_savings_show(struct device *dev, |
7944 | struct sysdev_class_attribute *attr, | 7944 | struct device_attribute *attr, |
7945 | char *page) | 7945 | char *buf) |
7946 | { | 7946 | { |
7947 | return sprintf(page, "%u\n", sched_mc_power_savings); | 7947 | return sprintf(buf, "%u\n", sched_mc_power_savings); |
7948 | } | 7948 | } |
7949 | static ssize_t sched_mc_power_savings_store(struct sysdev_class *class, | 7949 | static ssize_t sched_mc_power_savings_store(struct device *dev, |
7950 | struct sysdev_class_attribute *attr, | 7950 | struct device_attribute *attr, |
7951 | const char *buf, size_t count) | 7951 | const char *buf, size_t count) |
7952 | { | 7952 | { |
7953 | return sched_power_savings_store(buf, count, 0); | 7953 | return sched_power_savings_store(buf, count, 0); |
7954 | } | 7954 | } |
7955 | static SYSDEV_CLASS_ATTR(sched_mc_power_savings, 0644, | 7955 | static DEVICE_ATTR(sched_mc_power_savings, 0644, |
7956 | sched_mc_power_savings_show, | 7956 | sched_mc_power_savings_show, |
7957 | sched_mc_power_savings_store); | 7957 | sched_mc_power_savings_store); |
7958 | #endif | 7958 | #endif |
7959 | 7959 | ||
7960 | #ifdef CONFIG_SCHED_SMT | 7960 | #ifdef CONFIG_SCHED_SMT |
7961 | static ssize_t sched_smt_power_savings_show(struct sysdev_class *dev, | 7961 | static ssize_t sched_smt_power_savings_show(struct device *dev, |
7962 | struct sysdev_class_attribute *attr, | 7962 | struct device_attribute *attr, |
7963 | char *page) | 7963 | char *buf) |
7964 | { | 7964 | { |
7965 | return sprintf(page, "%u\n", sched_smt_power_savings); | 7965 | return sprintf(buf, "%u\n", sched_smt_power_savings); |
7966 | } | 7966 | } |
7967 | static ssize_t sched_smt_power_savings_store(struct sysdev_class *dev, | 7967 | static ssize_t sched_smt_power_savings_store(struct device *dev, |
7968 | struct sysdev_class_attribute *attr, | 7968 | struct device_attribute *attr, |
7969 | const char *buf, size_t count) | 7969 | const char *buf, size_t count) |
7970 | { | 7970 | { |
7971 | return sched_power_savings_store(buf, count, 1); | 7971 | return sched_power_savings_store(buf, count, 1); |
7972 | } | 7972 | } |
7973 | static SYSDEV_CLASS_ATTR(sched_smt_power_savings, 0644, | 7973 | static DEVICE_ATTR(sched_smt_power_savings, 0644, |
7974 | sched_smt_power_savings_show, | 7974 | sched_smt_power_savings_show, |
7975 | sched_smt_power_savings_store); | 7975 | sched_smt_power_savings_store); |
7976 | #endif | 7976 | #endif |
7977 | 7977 | ||
7978 | int __init sched_create_sysfs_power_savings_entries(struct sysdev_class *cls) | 7978 | int __init sched_create_sysfs_power_savings_entries(struct device *dev) |
7979 | { | 7979 | { |
7980 | int err = 0; | 7980 | int err = 0; |
7981 | 7981 | ||
7982 | #ifdef CONFIG_SCHED_SMT | 7982 | #ifdef CONFIG_SCHED_SMT |
7983 | if (smt_capable()) | 7983 | if (smt_capable()) |
7984 | err = sysfs_create_file(&cls->kset.kobj, | 7984 | err = device_create_file(dev, &dev_attr_sched_smt_power_savings); |
7985 | &attr_sched_smt_power_savings.attr); | ||
7986 | #endif | 7985 | #endif |
7987 | #ifdef CONFIG_SCHED_MC | 7986 | #ifdef CONFIG_SCHED_MC |
7988 | if (!err && mc_capable()) | 7987 | if (!err && mc_capable()) |
7989 | err = sysfs_create_file(&cls->kset.kobj, | 7988 | err = device_create_file(dev, &dev_attr_sched_mc_power_savings); |
7990 | &attr_sched_mc_power_savings.attr); | ||
7991 | #endif | 7989 | #endif |
7992 | return err; | 7990 | return err; |
7993 | } | 7991 | } |