diff options
author | Bart Van Assche <bvanassche@acm.org> | 2021-10-12 16:35:57 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-10-16 21:45:59 -0400 |
commit | 01e570febaaafd74d6625476e2665238c5e47e1e (patch) | |
tree | d6b7bdc2605fe7e0eb4f50199483d511987570db /drivers/usb/storage | |
parent | 7ce6000a77ccbe8b1c4fd053e9800476cd38fca3 (diff) |
scsi: usb: Switch to attribute groups
struct device supports attribute groups directly but does not support
struct device_attribute directly. Hence switch to attribute groups.
Link: https://lore.kernel.org/r/20211012233558.4066756-46-bvanassche@acm.org
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r-- | drivers/usb/storage/scsiglue.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index 220aa1cf4b3d..8931df5a85fd 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c @@ -587,11 +587,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 */ @@ -652,7 +654,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 |