Commit 66198f36 authored by Rabin Vincent's avatar Rabin Vincent Committed by Linus Torvalds

cpuidle: make sysfs attributes sysdev class attributes

These attributes are really sysdev class attributes.  The incorrect
definition leads to an oops because of recent changes which make sysdev
attributes use a different prototype.

Based on Andi's f718cd4a ("sched: make
scheduler sysfs attributes sysdev class devices")
Reported-by: default avatarEric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: default avatarRabin Vincent <rabin@rab.in>
Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
Cc: "Li, Shaohua" <shaohua.li@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 001e979d
...@@ -21,8 +21,8 @@ static int __init cpuidle_sysfs_setup(char *unused) ...@@ -21,8 +21,8 @@ static int __init cpuidle_sysfs_setup(char *unused)
} }
__setup("cpuidle_sysfs_switch", cpuidle_sysfs_setup); __setup("cpuidle_sysfs_switch", cpuidle_sysfs_setup);
static ssize_t show_available_governors(struct sys_device *dev, static ssize_t show_available_governors(struct sysdev_class *class,
struct sysdev_attribute *attr, char *buf) char *buf)
{ {
ssize_t i = 0; ssize_t i = 0;
struct cpuidle_governor *tmp; struct cpuidle_governor *tmp;
...@@ -40,8 +40,8 @@ static ssize_t show_available_governors(struct sys_device *dev, ...@@ -40,8 +40,8 @@ static ssize_t show_available_governors(struct sys_device *dev,
return i; return i;
} }
static ssize_t show_current_driver(struct sys_device *dev, static ssize_t show_current_driver(struct sysdev_class *class,
struct sysdev_attribute *attr, char *buf) char *buf)
{ {
ssize_t ret; ssize_t ret;
...@@ -55,8 +55,8 @@ static ssize_t show_current_driver(struct sys_device *dev, ...@@ -55,8 +55,8 @@ static ssize_t show_current_driver(struct sys_device *dev,
return ret; return ret;
} }
static ssize_t show_current_governor(struct sys_device *dev, static ssize_t show_current_governor(struct sysdev_class *class,
struct sysdev_attribute *attr, char *buf) char *buf)
{ {
ssize_t ret; ssize_t ret;
...@@ -70,8 +70,7 @@ static ssize_t show_current_governor(struct sys_device *dev, ...@@ -70,8 +70,7 @@ static ssize_t show_current_governor(struct sys_device *dev,
return ret; return ret;
} }
static ssize_t store_current_governor(struct sys_device *dev, static ssize_t store_current_governor(struct sysdev_class *class,
struct sysdev_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
char gov_name[CPUIDLE_NAME_LEN]; char gov_name[CPUIDLE_NAME_LEN];
...@@ -104,8 +103,9 @@ static ssize_t store_current_governor(struct sys_device *dev, ...@@ -104,8 +103,9 @@ static ssize_t store_current_governor(struct sys_device *dev,
return count; return count;
} }
static SYSDEV_ATTR(current_driver, 0444, show_current_driver, NULL); static SYSDEV_CLASS_ATTR(current_driver, 0444, show_current_driver, NULL);
static SYSDEV_ATTR(current_governor_ro, 0444, show_current_governor, NULL); static SYSDEV_CLASS_ATTR(current_governor_ro, 0444, show_current_governor,
NULL);
static struct attribute *cpuclass_default_attrs[] = { static struct attribute *cpuclass_default_attrs[] = {
&attr_current_driver.attr, &attr_current_driver.attr,
...@@ -113,8 +113,9 @@ static struct attribute *cpuclass_default_attrs[] = { ...@@ -113,8 +113,9 @@ static struct attribute *cpuclass_default_attrs[] = {
NULL NULL
}; };
static SYSDEV_ATTR(available_governors, 0444, show_available_governors, NULL); static SYSDEV_CLASS_ATTR(available_governors, 0444, show_available_governors,
static SYSDEV_ATTR(current_governor, 0644, show_current_governor, NULL);
static SYSDEV_CLASS_ATTR(current_governor, 0644, show_current_governor,
store_current_governor); store_current_governor);
static struct attribute *cpuclass_switch_attrs[] = { static struct attribute *cpuclass_switch_attrs[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment