Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 aa30f47cf666 ("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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Greg Kroah-Hartman and committed by
Rafael J. Wysocki
fe262d5c dfeeedc1

+9 -6
+3 -2
drivers/cpufreq/cpufreq.c
··· 924 924 cpufreq_freq_attr_rw(scaling_governor); 925 925 cpufreq_freq_attr_rw(scaling_setspeed); 926 926 927 - static struct attribute *default_attrs[] = { 927 + static struct attribute *cpufreq_attrs[] = { 928 928 &cpuinfo_min_freq.attr, 929 929 &cpuinfo_max_freq.attr, 930 930 &cpuinfo_transition_latency.attr, ··· 938 938 &scaling_setspeed.attr, 939 939 NULL 940 940 }; 941 + ATTRIBUTE_GROUPS(cpufreq); 941 942 942 943 #define to_policy(k) container_of(k, struct cpufreq_policy, kobj) 943 944 #define to_attr(a) container_of(a, struct freq_attr, attr) ··· 1001 1000 1002 1001 static struct kobj_type ktype_cpufreq = { 1003 1002 .sysfs_ops = &sysfs_ops, 1004 - .default_attrs = default_attrs, 1003 + .default_groups = cpufreq_groups, 1005 1004 .release = cpufreq_sysfs_release, 1006 1005 }; 1007 1006
+3 -2
drivers/cpufreq/cpufreq_conservative.c
··· 257 257 gov_attr_rw(down_threshold); 258 258 gov_attr_rw(freq_step); 259 259 260 - static struct attribute *cs_attributes[] = { 260 + static struct attribute *cs_attrs[] = { 261 261 &sampling_rate.attr, 262 262 &sampling_down_factor.attr, 263 263 &up_threshold.attr, ··· 266 266 &freq_step.attr, 267 267 NULL 268 268 }; 269 + ATTRIBUTE_GROUPS(cs); 269 270 270 271 /************************** sysfs end ************************/ 271 272 ··· 316 315 317 316 static struct dbs_governor cs_governor = { 318 317 .gov = CPUFREQ_DBS_GOVERNOR_INITIALIZER("conservative"), 319 - .kobj_type = { .default_attrs = cs_attributes }, 318 + .kobj_type = { .default_groups = cs_groups }, 320 319 .gov_dbs_update = cs_dbs_update, 321 320 .alloc = cs_alloc, 322 321 .free = cs_free,
+3 -2
drivers/cpufreq/cpufreq_ondemand.c
··· 328 328 gov_attr_rw(ignore_nice_load); 329 329 gov_attr_rw(powersave_bias); 330 330 331 - static struct attribute *od_attributes[] = { 331 + static struct attribute *od_attrs[] = { 332 332 &sampling_rate.attr, 333 333 &up_threshold.attr, 334 334 &sampling_down_factor.attr, ··· 337 337 &io_is_busy.attr, 338 338 NULL 339 339 }; 340 + ATTRIBUTE_GROUPS(od); 340 341 341 342 /************************** sysfs end ************************/ 342 343 ··· 402 401 403 402 static struct dbs_governor od_dbs_gov = { 404 403 .gov = CPUFREQ_DBS_GOVERNOR_INITIALIZER("ondemand"), 405 - .kobj_type = { .default_attrs = od_attributes }, 404 + .kobj_type = { .default_groups = od_groups }, 406 405 .gov_dbs_update = od_dbs_update, 407 406 .alloc = od_alloc, 408 407 .free = od_free,