Skip to content

Commit 7dfc5b6

Browse files
gregkhrafaeljw
authored andcommitted
cpuidle: 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 cpuidle sysfs code to use default_groups field which has been the preferred way since aa30f47 ("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>
1 parent d00ebcc commit 7dfc5b6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/cpuidle/sysfs.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ static struct attribute *cpuidle_state_default_attrs[] = {
335335
&attr_default_status.attr,
336336
NULL
337337
};
338+
ATTRIBUTE_GROUPS(cpuidle_state_default);
338339

339340
struct cpuidle_state_kobj {
340341
struct cpuidle_state *state;
@@ -448,7 +449,7 @@ static void cpuidle_state_sysfs_release(struct kobject *kobj)
448449

449450
static struct kobj_type ktype_state_cpuidle = {
450451
.sysfs_ops = &cpuidle_state_sysfs_ops,
451-
.default_attrs = cpuidle_state_default_attrs,
452+
.default_groups = cpuidle_state_default_groups,
452453
.release = cpuidle_state_sysfs_release,
453454
};
454455

@@ -591,10 +592,11 @@ static struct attribute *cpuidle_driver_default_attrs[] = {
591592
&attr_driver_name.attr,
592593
NULL
593594
};
595+
ATTRIBUTE_GROUPS(cpuidle_driver_default);
594596

595597
static struct kobj_type ktype_driver_cpuidle = {
596598
.sysfs_ops = &cpuidle_driver_sysfs_ops,
597-
.default_attrs = cpuidle_driver_default_attrs,
599+
.default_groups = cpuidle_driver_default_groups,
598600
.release = cpuidle_driver_sysfs_release,
599601
};
600602

0 commit comments

Comments
 (0)