Skip to content

Commit 7f99cb5

Browse files
gregkhsuryasaimadhu
authored andcommitted
x86/CPU/AMD: 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 AMD mce 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 the obsolete default_attrs field can be removed soon. Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Tested-by: Yazen Ghannam <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 26291c5 commit 7f99cb5

File tree

1 file changed

+4
-3
lines changed
  • arch/x86/kernel/cpu/mce

1 file changed

+4
-3
lines changed

arch/x86/kernel/cpu/mce/amd.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,7 @@ static struct attribute *default_attrs[] = {
993993
NULL, /* possibly interrupt_enable if supported, see below */
994994
NULL,
995995
};
996+
ATTRIBUTE_GROUPS(default);
996997

997998
#define to_block(k) container_of(k, struct threshold_block, kobj)
998999
#define to_attr(a) container_of(a, struct threshold_attr, attr)
@@ -1029,7 +1030,7 @@ static void threshold_block_release(struct kobject *kobj);
10291030

10301031
static struct kobj_type threshold_ktype = {
10311032
.sysfs_ops = &threshold_ops,
1032-
.default_attrs = default_attrs,
1033+
.default_groups = default_groups,
10331034
.release = threshold_block_release,
10341035
};
10351036

@@ -1101,10 +1102,10 @@ static int allocate_threshold_blocks(unsigned int cpu, struct threshold_bank *tb
11011102
b->threshold_limit = THRESHOLD_MAX;
11021103

11031104
if (b->interrupt_capable) {
1104-
threshold_ktype.default_attrs[2] = &interrupt_enable.attr;
1105+
default_attrs[2] = &interrupt_enable.attr;
11051106
b->interrupt_enable = 1;
11061107
} else {
1107-
threshold_ktype.default_attrs[2] = NULL;
1108+
default_attrs[2] = NULL;
11081109
}
11091110

11101111
INIT_LIST_HEAD(&b->miscj);

0 commit comments

Comments
 (0)