Commit fe262d5c authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Rafael J. Wysocki

cpufreq: use default_groups in kobj_type

There are currently 2 ways to create a set of sysfs files for a
kobj_type, through the default_attrs field, and the default_groups
field.  Move the cpufreq code to use default_groups field which has been
the preferred way since aa30f47c ("kobject: Add support for default
attribute groups to kobj_type") so that we can soon get rid of the
obsolete default_attrs field.
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent dfeeedc1
...@@ -924,7 +924,7 @@ cpufreq_freq_attr_rw(scaling_max_freq); ...@@ -924,7 +924,7 @@ cpufreq_freq_attr_rw(scaling_max_freq);
cpufreq_freq_attr_rw(scaling_governor); cpufreq_freq_attr_rw(scaling_governor);
cpufreq_freq_attr_rw(scaling_setspeed); cpufreq_freq_attr_rw(scaling_setspeed);
static struct attribute *default_attrs[] = { static struct attribute *cpufreq_attrs[] = {
&cpuinfo_min_freq.attr, &cpuinfo_min_freq.attr,
&cpuinfo_max_freq.attr, &cpuinfo_max_freq.attr,
&cpuinfo_transition_latency.attr, &cpuinfo_transition_latency.attr,
...@@ -938,6 +938,7 @@ static struct attribute *default_attrs[] = { ...@@ -938,6 +938,7 @@ static struct attribute *default_attrs[] = {
&scaling_setspeed.attr, &scaling_setspeed.attr,
NULL NULL
}; };
ATTRIBUTE_GROUPS(cpufreq);
#define to_policy(k) container_of(k, struct cpufreq_policy, kobj) #define to_policy(k) container_of(k, struct cpufreq_policy, kobj)
#define to_attr(a) container_of(a, struct freq_attr, attr) #define to_attr(a) container_of(a, struct freq_attr, attr)
...@@ -1000,7 +1001,7 @@ static const struct sysfs_ops sysfs_ops = { ...@@ -1000,7 +1001,7 @@ static const struct sysfs_ops sysfs_ops = {
static struct kobj_type ktype_cpufreq = { static struct kobj_type ktype_cpufreq = {
.sysfs_ops = &sysfs_ops, .sysfs_ops = &sysfs_ops,
.default_attrs = default_attrs, .default_groups = cpufreq_groups,
.release = cpufreq_sysfs_release, .release = cpufreq_sysfs_release,
}; };
......
...@@ -257,7 +257,7 @@ gov_attr_rw(ignore_nice_load); ...@@ -257,7 +257,7 @@ gov_attr_rw(ignore_nice_load);
gov_attr_rw(down_threshold); gov_attr_rw(down_threshold);
gov_attr_rw(freq_step); gov_attr_rw(freq_step);
static struct attribute *cs_attributes[] = { static struct attribute *cs_attrs[] = {
&sampling_rate.attr, &sampling_rate.attr,
&sampling_down_factor.attr, &sampling_down_factor.attr,
&up_threshold.attr, &up_threshold.attr,
...@@ -266,6 +266,7 @@ static struct attribute *cs_attributes[] = { ...@@ -266,6 +266,7 @@ static struct attribute *cs_attributes[] = {
&freq_step.attr, &freq_step.attr,
NULL NULL
}; };
ATTRIBUTE_GROUPS(cs);
/************************** sysfs end ************************/ /************************** sysfs end ************************/
...@@ -315,7 +316,7 @@ static void cs_start(struct cpufreq_policy *policy) ...@@ -315,7 +316,7 @@ static void cs_start(struct cpufreq_policy *policy)
static struct dbs_governor cs_governor = { static struct dbs_governor cs_governor = {
.gov = CPUFREQ_DBS_GOVERNOR_INITIALIZER("conservative"), .gov = CPUFREQ_DBS_GOVERNOR_INITIALIZER("conservative"),
.kobj_type = { .default_attrs = cs_attributes }, .kobj_type = { .default_groups = cs_groups },
.gov_dbs_update = cs_dbs_update, .gov_dbs_update = cs_dbs_update,
.alloc = cs_alloc, .alloc = cs_alloc,
.free = cs_free, .free = cs_free,
......
...@@ -328,7 +328,7 @@ gov_attr_rw(sampling_down_factor); ...@@ -328,7 +328,7 @@ gov_attr_rw(sampling_down_factor);
gov_attr_rw(ignore_nice_load); gov_attr_rw(ignore_nice_load);
gov_attr_rw(powersave_bias); gov_attr_rw(powersave_bias);
static struct attribute *od_attributes[] = { static struct attribute *od_attrs[] = {
&sampling_rate.attr, &sampling_rate.attr,
&up_threshold.attr, &up_threshold.attr,
&sampling_down_factor.attr, &sampling_down_factor.attr,
...@@ -337,6 +337,7 @@ static struct attribute *od_attributes[] = { ...@@ -337,6 +337,7 @@ static struct attribute *od_attributes[] = {
&io_is_busy.attr, &io_is_busy.attr,
NULL NULL
}; };
ATTRIBUTE_GROUPS(od);
/************************** sysfs end ************************/ /************************** sysfs end ************************/
...@@ -401,7 +402,7 @@ static struct od_ops od_ops = { ...@@ -401,7 +402,7 @@ static struct od_ops od_ops = {
static struct dbs_governor od_dbs_gov = { static struct dbs_governor od_dbs_gov = {
.gov = CPUFREQ_DBS_GOVERNOR_INITIALIZER("ondemand"), .gov = CPUFREQ_DBS_GOVERNOR_INITIALIZER("ondemand"),
.kobj_type = { .default_attrs = od_attributes }, .kobj_type = { .default_groups = od_groups },
.gov_dbs_update = od_dbs_update, .gov_dbs_update = od_dbs_update,
.alloc = od_alloc, .alloc = od_alloc,
.free = od_free, .free = od_free,
......
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