On Thu, Feb 02, 2023 at 04:28:00PM -0600, Brian King wrote:
> Use the dev_groups functionality to manage the attribute groups
> for hvcs devices. This simplifies the code and also eliminates
> errors coming from kernfs when attempting to remove a console
> device that is in use.
> 
> Signed-off-by: Brian King <brk...@linux.vnet.ibm.com>
> ---
>  drivers/tty/hvc/hvcs.c | 24 +++++++++++-------------
>  1 file changed, 11 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c
> index faf5ccfc561e..7f79444b4d89 100644
> --- a/drivers/tty/hvc/hvcs.c
> +++ b/drivers/tty/hvc/hvcs.c
> @@ -432,7 +432,7 @@ static ssize_t hvcs_index_show(struct device *dev, struct 
> device_attribute *attr
>  
>  static DEVICE_ATTR(index, S_IRUGO, hvcs_index_show, NULL);
>  
> -static struct attribute *hvcs_attrs[] = {
> +static struct attribute *hvcs_dev_attrs[] = {
>       &dev_attr_partner_vtys.attr,
>       &dev_attr_partner_clcs.attr,
>       &dev_attr_current_vty.attr,
> @@ -441,8 +441,13 @@ static struct attribute *hvcs_attrs[] = {
>       NULL,
>  };
>  
> -static struct attribute_group hvcs_attr_group = {
> -     .attrs = hvcs_attrs,
> +static struct attribute_group hvcs_attr_dev_group = {
> +     .attrs = hvcs_dev_attrs,
> +};
> +
> +const static struct attribute_group *hvcs_attr_dev_groups[] = {
> +     &hvcs_attr_dev_group,
> +     NULL,
>  };

Why not just use the ATTRIBUTE_GROUPS() macro here?

thanks,

greg k-h

Reply via email to