Skip to contentSkip to conversation

staging: greybus: auto_manager: use default_groups in kobj_type

PATCH In review Greg Kroah-Hartman 3 participants 3 messages Dec 28, 2021 – Dec 29, 2021

Subsystems (3)
lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH 1/1 staging: greybus: auto_manager: 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 greybus audio 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/staging/greybus/audio_manager_module.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/greybus/audio_manager_module.c +2 -1
index 525cf8f8394f..0a0f0a394c84 100644
@@ -142,11 +142,12 @@ static struct attribute *gb_audio_module_default_attrs[] = {
 	&gb_audio_module_op_devices_attribute.attr,
 	NULL,   /* need to NULL terminate the list of attributes */
 };
+ATTRIBUTE_GROUPS(gb_audio_module_default);
 
 static struct kobj_type gb_audio_module_type = {
 	.sysfs_ops = &gb_audio_module_sysfs_ops,
 	.release = gb_audio_module_release,
-	.default_attrs = gb_audio_module_default_attrs,
+	.default_groups = gb_audio_module_default_groups,
 };
 
 static void send_add_uevent(struct gb_audio_manager_module *module)
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Greg Kroah-Hartman

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 greybus audio 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.

Quoted 7 lines

Nice and simple to convert this (as it should be). Looks good to me.

Quoted 23 lines
---
  drivers/staging/greybus/audio_manager_module.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/greybus/audio_manager_module.c +2 -1
index 525cf8f8394f..0a0f0a394c84 100644
@@ -142,11 +142,12 @@ static struct attribute *gb_audio_module_default_attrs[] = {
  	&gb_audio_module_op_devices_attribute.attr,
  	NULL,   /* need to NULL terminate the list of attributes */
  };
+ATTRIBUTE_GROUPS(gb_audio_module_default);
 
  static struct kobj_type gb_audio_module_type = {
  	.sysfs_ops = &gb_audio_module_sysfs_ops,
  	.release = gb_audio_module_release,
-	.default_attrs = gb_audio_module_default_attrs,
+	.default_groups = gb_audio_module_default_groups,
  };
 
  static void send_add_uevent(struct gb_audio_manager_module *module)
maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Greg Kroah-Hartman
Quoted 38 lines · Greg Kroah-Hartman

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 greybus audio 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/staging/greybus/audio_manager_module.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/greybus/audio_manager_module.c +2 -1
index 525cf8f8394f..0a0f0a394c84 100644
@@ -142,11 +142,12 @@ static struct attribute *gb_audio_module_default_attrs[] = {
 	&gb_audio_module_op_devices_attribute.attr,
 	NULL,   /* need to NULL terminate the list of attributes */
 };
+ATTRIBUTE_GROUPS(gb_audio_module_default);
 
 static struct kobj_type gb_audio_module_type = {
 	.sysfs_ops = &gb_audio_module_sysfs_ops,
 	.release = gb_audio_module_release,
-	.default_attrs = gb_audio_module_default_attrs,
+	.default_groups = gb_audio_module_default_groups,
 };
 
 static void send_add_uevent(struct gb_audio_manager_module *module)
Signature · 1 line
2.34.1

Nice!