[PATCH v2 3/6] hvcs: Use driver groups to manage driver attributes

Greg KH gregkh at linuxfoundation.org
Fri Feb 3 16:11:02 AEDT 2023


On Thu, Feb 02, 2023 at 04:28:01PM -0600, Brian King wrote:
> Rather than manually creating attributes for the hvcs driver,
> let the driver core do this for us. This also fixes some hotplug
> remove issues and ensures that cleanup of these attributes
> is done in the right order.
> 
> Signed-off-by: Brian King <brking at linux.vnet.ibm.com>
> ---
>  drivers/tty/hvc/hvcs.c | 24 +++++++++++++++---------
>  1 file changed, 15 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c
> index 7f79444b4d89..5de7ad555540 100644
> --- a/drivers/tty/hvc/hvcs.c
> +++ b/drivers/tty/hvc/hvcs.c
> @@ -473,6 +473,20 @@ static ssize_t rescan_store(struct device_driver *ddp, const char * buf,
>  
>  static DRIVER_ATTR_RW(rescan);
>  
> +static struct attribute *hvcs_attrs[] = {
> +	&driver_attr_rescan.attr,
> +	NULL,
> +};
> +
> +static struct attribute_group hvcs_attr_group = {
> +	.attrs = hvcs_attrs,
> +};
> +
> +const static struct attribute_group *hvcs_attr_groups[] = {
> +	&hvcs_attr_group,
> +	NULL,
> +};

Again, ATTRIBUTE_GROUPS()?

thanks,

greg k-h


More information about the Linuxppc-dev mailing list