Skip to content

Commit cce55cc

Browse files
guohanjunrafaeljw
authored andcommitted
cpuidle: sysfs: Remove sysfs_switch and switch attributes
Since the cpuidle governor can be switched via sysfs in default, remove sysfs_switch and cpuidle_switch_attrs. Signed-off-by: Hanjun Guo <[email protected]> Reviewed-by: Doug Smythies <[email protected]> Tested-by: Doug Smythies <[email protected]> Acked-by: Daniel Lezcano <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent b52e93e commit cce55cc

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

drivers/cpuidle/sysfs.c

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@
1818

1919
#include "cpuidle.h"
2020

21-
static unsigned int sysfs_switch;
22-
static int __init cpuidle_sysfs_setup(char *unused)
23-
{
24-
sysfs_switch = 1;
25-
return 1;
26-
}
27-
__setup("cpuidle_sysfs_switch", cpuidle_sysfs_setup);
28-
2921
static ssize_t show_available_governors(struct device *dev,
3022
struct device_attribute *attr,
3123
char *buf)
@@ -112,23 +104,16 @@ static DEVICE_ATTR(current_governor, 0644, show_current_governor,
112104
store_current_governor);
113105
static DEVICE_ATTR(current_governor_ro, 0444, show_current_governor, NULL);
114106

115-
static struct attribute *cpuidle_default_attrs[] = {
107+
static struct attribute *cpuidle_attrs[] = {
116108
&dev_attr_available_governors.attr,
117109
&dev_attr_current_driver.attr,
118110
&dev_attr_current_governor.attr,
119111
&dev_attr_current_governor_ro.attr,
120112
NULL
121113
};
122114

123-
static struct attribute *cpuidle_switch_attrs[] = {
124-
&dev_attr_available_governors.attr,
125-
&dev_attr_current_driver.attr,
126-
&dev_attr_current_governor.attr,
127-
NULL
128-
};
129-
130115
static struct attribute_group cpuidle_attr_group = {
131-
.attrs = cpuidle_default_attrs,
116+
.attrs = cpuidle_attrs,
132117
.name = "cpuidle",
133118
};
134119

@@ -138,9 +123,6 @@ static struct attribute_group cpuidle_attr_group = {
138123
*/
139124
int cpuidle_add_interface(struct device *dev)
140125
{
141-
if (sysfs_switch)
142-
cpuidle_attr_group.attrs = cpuidle_switch_attrs;
143-
144126
return sysfs_create_group(&dev->kobj, &cpuidle_attr_group);
145127
}
146128

0 commit comments

Comments
 (0)