PCI: slot: use default_groups in kobj_type
PATCH 1/1 PCI: slot: 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 PCI slot 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.
--- drivers/pci/slot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pci/slot.c +2 -1
@@ -96,11 +96,12 @@ static struct attribute *pci_slot_default_attrs[] = { &pci_slot_attr_cur_speed.attr,NULL , }; +ATTRIBUTE_GROUPS (pci_slot_default);static struct kobj_type pci_slot_ktype = { .sysfs_ops = &pci_slot_sysfs_ops, .release = &pci_slot_release, - .default_attrs = pci_slot_default_attrs, + .default_groups = pci_slot_default_groups, };static char *make_slot_name (const char *name)
Signature · 1 line
2.34.1
Bjorn Helgaas
AppliedQuoted 10 lines · Greg Kroah-Hartman
There are currently 2 ways to create a set of sysfs files for a
kobj_type, through thedefault_attrsfield, and thedefault_groupsfield. Move the PCI slot code to usedefault_groupsfield which has been the preferred way sinceaa30f47cf666("kobject: Add support for default attribute groups tokobj_type") so that we can soon get rid of the obsoletedefault_attrsfield.Cc Bjorn Helgaas <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Applied to pci/enumeration for v5.17, thanks!
Quoted 25 lines
--- drivers/pci/slot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/pci/slot.c +2
-1@@ -96,11 +96,12 @@ static struct attribute *pci_slot_default_attrs[] = { &pci_slot_attr_cur_speed.attr,NULL , }; +ATTRIBUTE_GROUPS (pci_slot_default);static struct kobj_type pci_slot_ktype = { .sysfs_ops = &pci_slot_sysfs_ops, .release = &pci_slot_release, - .default_attrs = pci_slot_default_attrs, + .default_groups = pci_slot_default_groups, };static char *make_slot_name (const char *name)Signature · 1 line
2.34.1