[PATCH v2 24/46] scsi: ibmvfc: Switch to attribute groups

Bart Van Assche
2021-10-07T21:20:02Z

drivers/scsi/ibmvscsi/ibmvfc.c | 29 +++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 1f1586ad48fe..d4509b043d86 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -3588,15 +3588,24 @@ static struct bin_attribute ibmvfc_trace_attr = {
};
#endif

-static struct device_attribute *ibmvfc_attrs[] = {
- &dev_attr_partition_name,
- &dev_attr_device_name,
- &dev_attr_port_loc_code,
- &dev_attr_drc_name,
- &dev_attr_npiv_version,
- &dev_attr_capabilities,
- &dev_attr_log_level,
- &dev_attr_nr_scsi_channels,
+static struct attribute *ibmvfc_attrs[] = {
+ &dev_attr_partition_name.attr,
+ &dev_attr_device_name.attr,
+ &dev_attr_port_loc_code.attr,
+ &dev_attr_drc_name.attr,
+ &dev_attr_npiv_version.attr,
+ &dev_attr_capabilities.attr,
+ &dev_attr_log_level.attr,
+ &dev_attr_nr_scsi_channels.attr,
+ NULL
+};
+
+static const struct attribute_group ibmvfc_attr_group = {
+ .attrs = ibmvfc_attrs
+};
+
+static const struct attribute_group *ibmvfc_attr_groups[] = {
+ &ibmvfc_attr_group,
NULL
};

@@ -3620,7 +3629,7 @@ static struct scsi_host_template driver_template = {
.this_id = -1,
.sg_tablesize = SG_ALL,
.max_sectors = IBMVFC_MAX_SECTORS,
- .shost_attrs = ibmvfc_attrs,
+ .shost_groups = ibmvfc_attr_groups,
.track_queue_depth = 1,
.host_tagset = 1,
};