Re: [PATCH v3 45/46] scsi: usb: Switch to attribute groups

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

 



On Fri, Oct 08, 2021 at 01:23:52PM -0700, Bart Van Assche wrote:
> struct device supports attribute groups directly but does not support
> struct device_attribute directly. Hence switch to attribute groups.
> 
> Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
> ---
>  drivers/usb/storage/scsiglue.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
> index e5a971b83e3f..4e5a928f0368 100644
> --- a/drivers/usb/storage/scsiglue.c
> +++ b/drivers/usb/storage/scsiglue.c
> @@ -588,11 +588,13 @@ static ssize_t max_sectors_store(struct device *dev, struct device_attribute *at
>  }
>  static DEVICE_ATTR_RW(max_sectors);
>  
> -static struct device_attribute *sysfs_device_attr_list[] = {
> -	&dev_attr_max_sectors,
> +static struct attribute *usb_sdev_attrs[] = {
> +	&dev_attr_max_sectors.attr,
>  	NULL,
>  };
>  
> +ATTRIBUTE_GROUPS(usb_sdev);
> +
>  /*
>   * this defines our host template, with which we'll allocate hosts
>   */
> @@ -653,7 +655,7 @@ static const struct scsi_host_template usb_stor_host_template = {
>  	.skip_settle_delay =		1,
>  
>  	/* sysfs device attributes */
> -	.sdev_attrs =			sysfs_device_attr_list,
> +	.sdev_groups =			usb_sdev_groups,
>  
>  	/* module management */
>  	.module =			THIS_MODULE


Acked-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux