[PATCH v2 09/46] scsi: 3w-xxxx: Switch to attribute groups

Bart Van Assche
2021-10-07T21:19:18Z

drivers/scsi/3w-xxxx.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
index 4ee485ab2714..3994df64b43b 100644
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -532,11 +532,20 @@ static struct device_attribute tw_host_stats_attr = {
};

/* Host attributes initializer */
-static struct device_attribute *tw_host_attrs[] = {
- &tw_host_stats_attr,
+static struct attribute *tw_host_attrs[] = {
+ &tw_host_stats_attr.attr,
NULL,
};

+static const struct attribute_group tw_host_attr_group = {
+ .attrs = tw_host_attrs
+};
+
+static const struct attribute_group *tw_host_attr_groups[] = {
+ &tw_host_attr_group,
+ NULL
+};
+
/* This function will read the aen queue from the isr */
static int tw_aen_read_queue(TW_Device_Extension *tw_dev, int request_id)
{
@@ -2242,7 +2251,7 @@ static struct scsi_host_template driver_template = {
.sg_tablesize = TW_MAX_SGL_LENGTH,
.max_sectors = TW_MAX_SECTORS,
.cmd_per_lun = TW_MAX_CMDS_PER_LUN,
- .shost_attrs = tw_host_attrs,
+ .shost_groups = tw_host_attr_groups,
.emulated = 1,
.no_write_same = 1,
};