diff options
author | Bart Van Assche <bvanassche@acm.org> | 2021-10-13 01:35:53 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-10-17 03:45:59 +0200 |
commit | a8b476fc86d9a6580410ef4690bbb152cc027a34 (patch) | |
tree | b92a577c48bea73ad257739d7107717aa84a5bf0 /drivers/scsi/qla4xxx | |
parent | scsi: qla2xxx: Switch to attribute groups (diff) | |
download | linux-a8b476fc86d9a6580410ef4690bbb152cc027a34.tar.xz linux-a8b476fc86d9a6580410ef4690bbb152cc027a34.zip |
scsi: qla4xxx: 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-42-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla4xxx')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_attr.c | 41 | ||||
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_glbl.h | 3 | ||||
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_os.c | 2 |
3 files changed, 28 insertions, 18 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_attr.c b/drivers/scsi/qla4xxx/ql4_attr.c index ec4352818fbf..abfa6ef60480 100644 --- a/drivers/scsi/qla4xxx/ql4_attr.c +++ b/drivers/scsi/qla4xxx/ql4_attr.c @@ -330,21 +330,30 @@ static DEVICE_ATTR(fw_ext_timestamp, S_IRUGO, qla4xxx_fw_ext_timestamp_show, static DEVICE_ATTR(fw_load_src, S_IRUGO, qla4xxx_fw_load_src_show, NULL); static DEVICE_ATTR(fw_uptime, S_IRUGO, qla4xxx_fw_uptime_show, NULL); -struct device_attribute *qla4xxx_host_attrs[] = { - &dev_attr_fw_version, - &dev_attr_serial_num, - &dev_attr_iscsi_version, - &dev_attr_optrom_version, - &dev_attr_board_id, - &dev_attr_fw_state, - &dev_attr_phy_port_cnt, - &dev_attr_phy_port_num, - &dev_attr_iscsi_func_cnt, - &dev_attr_hba_model, - &dev_attr_fw_timestamp, - &dev_attr_fw_build_user, - &dev_attr_fw_ext_timestamp, - &dev_attr_fw_load_src, - &dev_attr_fw_uptime, +static struct attribute *qla4xxx_host_attrs[] = { + &dev_attr_fw_version.attr, + &dev_attr_serial_num.attr, + &dev_attr_iscsi_version.attr, + &dev_attr_optrom_version.attr, + &dev_attr_board_id.attr, + &dev_attr_fw_state.attr, + &dev_attr_phy_port_cnt.attr, + &dev_attr_phy_port_num.attr, + &dev_attr_iscsi_func_cnt.attr, + &dev_attr_hba_model.attr, + &dev_attr_fw_timestamp.attr, + &dev_attr_fw_build_user.attr, + &dev_attr_fw_ext_timestamp.attr, + &dev_attr_fw_load_src.attr, + &dev_attr_fw_uptime.attr, NULL, }; + +static const struct attribute_group qla4xxx_host_attr_group = { + .attrs = qla4xxx_host_attrs +}; + +const struct attribute_group *qla4xxx_host_groups[] = { + &qla4xxx_host_attr_group, + NULL +}; diff --git a/drivers/scsi/qla4xxx/ql4_glbl.h b/drivers/scsi/qla4xxx/ql4_glbl.h index ea60057b2e20..c0873381508d 100644 --- a/drivers/scsi/qla4xxx/ql4_glbl.h +++ b/drivers/scsi/qla4xxx/ql4_glbl.h @@ -286,5 +286,6 @@ extern int ql4xenablemsix; extern int ql4xmdcapmask; extern int ql4xenablemd; -extern struct device_attribute *qla4xxx_host_attrs[]; +extern const struct attribute_group *qla4xxx_host_groups[]; + #endif /* _QLA4x_GBL_H */ diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 76d0b59a9982..8987acc24dac 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -241,7 +241,7 @@ static struct scsi_host_template qla4xxx_driver_template = { .sg_tablesize = SG_ALL, .max_sectors = 0xFFFF, - .shost_attrs = qla4xxx_host_attrs, + .shost_groups = qla4xxx_host_groups, .host_reset = qla4xxx_host_reset, .vendor_id = SCSI_NL_VID_TYPE_PCI | PCI_VENDOR_ID_QLOGIC, }; |