Commit e73af234 authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: bfa: 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-15-bvanassche@acm.orgSigned-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent ebcbac34
...@@ -956,36 +956,52 @@ static DEVICE_ATTR(driver_name, S_IRUGO, bfad_im_drv_name_show, NULL); ...@@ -956,36 +956,52 @@ static DEVICE_ATTR(driver_name, S_IRUGO, bfad_im_drv_name_show, NULL);
static DEVICE_ATTR(number_of_discovered_ports, S_IRUGO, static DEVICE_ATTR(number_of_discovered_ports, S_IRUGO,
bfad_im_num_of_discovered_ports_show, NULL); bfad_im_num_of_discovered_ports_show, NULL);
struct device_attribute *bfad_im_host_attrs[] = { static struct attribute *bfad_im_host_attrs[] = {
&dev_attr_serial_number, &dev_attr_serial_number.attr,
&dev_attr_model, &dev_attr_model.attr,
&dev_attr_model_description, &dev_attr_model_description.attr,
&dev_attr_node_name, &dev_attr_node_name.attr,
&dev_attr_symbolic_name, &dev_attr_symbolic_name.attr,
&dev_attr_hardware_version, &dev_attr_hardware_version.attr,
&dev_attr_driver_version, &dev_attr_driver_version.attr,
&dev_attr_option_rom_version, &dev_attr_option_rom_version.attr,
&dev_attr_firmware_version, &dev_attr_firmware_version.attr,
&dev_attr_number_of_ports, &dev_attr_number_of_ports.attr,
&dev_attr_driver_name, &dev_attr_driver_name.attr,
&dev_attr_number_of_discovered_ports, &dev_attr_number_of_discovered_ports.attr,
NULL, NULL,
}; };
struct device_attribute *bfad_im_vport_attrs[] = { static const struct attribute_group bfad_im_host_attr_group = {
&dev_attr_serial_number, .attrs = bfad_im_host_attrs
&dev_attr_model, };
&dev_attr_model_description,
&dev_attr_node_name, const struct attribute_group *bfad_im_host_groups[] = {
&dev_attr_symbolic_name, &bfad_im_host_attr_group,
&dev_attr_hardware_version, NULL
&dev_attr_driver_version, };
&dev_attr_option_rom_version,
&dev_attr_firmware_version, struct attribute *bfad_im_vport_attrs[] = {
&dev_attr_number_of_ports, &dev_attr_serial_number.attr,
&dev_attr_driver_name, &dev_attr_model.attr,
&dev_attr_number_of_discovered_ports, &dev_attr_model_description.attr,
&dev_attr_node_name.attr,
&dev_attr_symbolic_name.attr,
&dev_attr_hardware_version.attr,
&dev_attr_driver_version.attr,
&dev_attr_option_rom_version.attr,
&dev_attr_firmware_version.attr,
&dev_attr_number_of_ports.attr,
&dev_attr_driver_name.attr,
&dev_attr_number_of_discovered_ports.attr,
NULL, NULL,
}; };
static const struct attribute_group bfad_im_vport_attr_group = {
.attrs = bfad_im_vport_attrs
};
const struct attribute_group *bfad_im_vport_groups[] = {
&bfad_im_vport_attr_group,
NULL
};
...@@ -809,7 +809,7 @@ struct scsi_host_template bfad_im_scsi_host_template = { ...@@ -809,7 +809,7 @@ struct scsi_host_template bfad_im_scsi_host_template = {
.this_id = -1, .this_id = -1,
.sg_tablesize = BFAD_IO_MAX_SGE, .sg_tablesize = BFAD_IO_MAX_SGE,
.cmd_per_lun = 3, .cmd_per_lun = 3,
.shost_attrs = bfad_im_host_attrs, .shost_groups = bfad_im_host_groups,
.max_sectors = BFAD_MAX_SECTORS, .max_sectors = BFAD_MAX_SECTORS,
.vendor_id = BFA_PCI_VENDOR_ID_BROCADE, .vendor_id = BFA_PCI_VENDOR_ID_BROCADE,
}; };
...@@ -831,7 +831,7 @@ struct scsi_host_template bfad_im_vport_template = { ...@@ -831,7 +831,7 @@ struct scsi_host_template bfad_im_vport_template = {
.this_id = -1, .this_id = -1,
.sg_tablesize = BFAD_IO_MAX_SGE, .sg_tablesize = BFAD_IO_MAX_SGE,
.cmd_per_lun = 3, .cmd_per_lun = 3,
.shost_attrs = bfad_im_vport_attrs, .shost_groups = bfad_im_vport_groups,
.max_sectors = BFAD_MAX_SECTORS, .max_sectors = BFAD_MAX_SECTORS,
}; };
......
...@@ -174,8 +174,8 @@ extern struct fc_function_template bfad_im_vport_fc_function_template; ...@@ -174,8 +174,8 @@ extern struct fc_function_template bfad_im_vport_fc_function_template;
extern struct scsi_transport_template *bfad_im_scsi_transport_template; extern struct scsi_transport_template *bfad_im_scsi_transport_template;
extern struct scsi_transport_template *bfad_im_scsi_vport_transport_template; extern struct scsi_transport_template *bfad_im_scsi_vport_transport_template;
extern struct device_attribute *bfad_im_host_attrs[]; extern const struct attribute_group *bfad_im_host_groups[];
extern struct device_attribute *bfad_im_vport_attrs[]; extern const struct attribute_group *bfad_im_vport_groups[];
irqreturn_t bfad_intx(int irq, void *dev_id); irqreturn_t bfad_intx(int irq, void *dev_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment