Skip to content

Commit ad8a5d1

Browse files
committed
qemu_fw_cfg: 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 firmware qemu_fw_cfg 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. Cc: Gabriel Somlo <[email protected]> Cc: "Michael S. Tsirkin" <[email protected]> Cc: [email protected] Acked-by: Michael S. Tsirkin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f54dfdf commit ad8a5d1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/firmware/qemu_fw_cfg.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ static void fw_cfg_sysfs_cache_cleanup(void)
395395
}
396396
}
397397

398-
/* default_attrs: per-entry attributes and show methods */
398+
/* per-entry attributes and show methods */
399399

400400
#define FW_CFG_SYSFS_ATTR(_attr) \
401401
struct fw_cfg_sysfs_attribute fw_cfg_sysfs_attr_##_attr = { \
@@ -428,6 +428,7 @@ static struct attribute *fw_cfg_sysfs_entry_attrs[] = {
428428
&fw_cfg_sysfs_attr_name.attr,
429429
NULL,
430430
};
431+
ATTRIBUTE_GROUPS(fw_cfg_sysfs_entry);
431432

432433
/* sysfs_ops: find fw_cfg_[entry, attribute] and call appropriate show method */
433434
static ssize_t fw_cfg_sysfs_attr_show(struct kobject *kobj, struct attribute *a,
@@ -454,7 +455,7 @@ static void fw_cfg_sysfs_release_entry(struct kobject *kobj)
454455

455456
/* kobj_type: ties together all properties required to register an entry */
456457
static struct kobj_type fw_cfg_sysfs_entry_ktype = {
457-
.default_attrs = fw_cfg_sysfs_entry_attrs,
458+
.default_groups = fw_cfg_sysfs_entry_groups,
458459
.sysfs_ops = &fw_cfg_sysfs_attr_ops,
459460
.release = fw_cfg_sysfs_release_entry,
460461
};

0 commit comments

Comments
 (0)