LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: greybus: auto_manager: use default_groups in kobj_type
@ 2021-12-28 13:55 Greg Kroah-Hartman
  2021-12-28 14:25 ` [greybus-dev] " Alex Elder
  2021-12-29  0:47 ` Mark Greer
  0 siblings, 2 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2021-12-28 13:55 UTC (permalink / raw
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Vaibhav Agarwal, Mark Greer, Johan Hovold,
	Alex Elder, greybus-dev, linux-staging

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.

Cc: Vaibhav Agarwal <vaibhav.sr@gmail.com>
Cc: Mark Greer <mgreer@animalcreek.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: Alex Elder <elder@kernel.org>
Cc: greybus-dev@lists.linaro.org
Cc: linux-staging@lists.linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/staging/greybus/audio_manager_module.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/audio_manager_module.c b/drivers/staging/greybus/audio_manager_module.c
index 525cf8f8394f..0a0f0a394c84 100644
--- a/drivers/staging/greybus/audio_manager_module.c
+++ b/drivers/staging/greybus/audio_manager_module.c
@@ -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)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [greybus-dev] [PATCH] staging: greybus: auto_manager: use default_groups in kobj_type
  2021-12-28 13:55 [PATCH] staging: greybus: auto_manager: use default_groups in kobj_type Greg Kroah-Hartman
@ 2021-12-28 14:25 ` Alex Elder
  2021-12-29  0:47 ` Mark Greer
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Elder @ 2021-12-28 14:25 UTC (permalink / raw
  To: Greg Kroah-Hartman, linux-kernel
  Cc: Alex Elder, linux-staging, Johan Hovold, greybus-dev

On 12/28/21 7:55 AM, Greg Kroah-Hartman wrote:
> 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.
> 
> Cc: Vaibhav Agarwal <vaibhav.sr@gmail.com>
> Cc: Mark Greer <mgreer@animalcreek.com>
> Cc: Johan Hovold <johan@kernel.org>
> Cc: Alex Elder <elder@kernel.org>
> Cc: greybus-dev@lists.linaro.org
> Cc: linux-staging@lists.linux.dev
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

Reviewed-by: Alex Elder <elder@linaro.org>

> ---
>   drivers/staging/greybus/audio_manager_module.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/greybus/audio_manager_module.c b/drivers/staging/greybus/audio_manager_module.c
> index 525cf8f8394f..0a0f0a394c84 100644
> --- a/drivers/staging/greybus/audio_manager_module.c
> +++ b/drivers/staging/greybus/audio_manager_module.c
> @@ -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)
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: greybus: auto_manager: use default_groups in kobj_type
  2021-12-28 13:55 [PATCH] staging: greybus: auto_manager: use default_groups in kobj_type Greg Kroah-Hartman
  2021-12-28 14:25 ` [greybus-dev] " Alex Elder
@ 2021-12-29  0:47 ` Mark Greer
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Greer @ 2021-12-29  0:47 UTC (permalink / raw
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Vaibhav Agarwal, Mark Greer, Johan Hovold,
	Alex Elder, greybus-dev, linux-staging

On Tue, Dec 28, 2021 at 02:55:41PM +0100, Greg Kroah-Hartman wrote:
> 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.
> 
> Cc: Vaibhav Agarwal <vaibhav.sr@gmail.com>
> Cc: Mark Greer <mgreer@animalcreek.com>
> Cc: Johan Hovold <johan@kernel.org>
> Cc: Alex Elder <elder@kernel.org>
> Cc: greybus-dev@lists.linaro.org
> Cc: linux-staging@lists.linux.dev
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  drivers/staging/greybus/audio_manager_module.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/greybus/audio_manager_module.c b/drivers/staging/greybus/audio_manager_module.c
> index 525cf8f8394f..0a0f0a394c84 100644
> --- a/drivers/staging/greybus/audio_manager_module.c
> +++ b/drivers/staging/greybus/audio_manager_module.c
> @@ -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)
> -- 
> 2.34.1

Nice!

Acked-by: Mark Greer <mgreer@animalcreek.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-29  0:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-28 13:55 [PATCH] staging: greybus: auto_manager: use default_groups in kobj_type Greg Kroah-Hartman
2021-12-28 14:25 ` [greybus-dev] " Alex Elder
2021-12-29  0:47 ` Mark Greer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).