Re: [PATCH v2 2/6] hvcs: Use dev_groups to manage hvcs device attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <brking@xxxxxxxxxxxxxxxxxx>
> ---
>  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



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux