scsi: pm8001: Switch to attribute groups
authorBart Van Assche <bvanassche@acm.org>
Tue, 12 Oct 2021 23:35:47 +0000 (16:35 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 17 Oct 2021 01:45:58 +0000 (21:45 -0400)
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-36-bvanassche@acm.org
Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/pm8001/pm8001_ctl.c
drivers/scsi/pm8001/pm8001_init.c
drivers/scsi/pm8001/pm8001_sas.h

index b25e447..397eb9f 100644 (file)
@@ -1002,34 +1002,42 @@ static ssize_t ctl_iop1_count_show(struct device *cdev,
 }
 static DEVICE_ATTR_RO(ctl_iop1_count);
 
-struct device_attribute *pm8001_host_attrs[] = {
-       &dev_attr_interface_rev,
-       &dev_attr_controller_fatal_error,
-       &dev_attr_fw_version,
-       &dev_attr_update_fw,
-       &dev_attr_aap_log,
-       &dev_attr_iop_log,
-       &dev_attr_fatal_log,
-       &dev_attr_non_fatal_log,
-       &dev_attr_non_fatal_count,
-       &dev_attr_gsm_log,
-       &dev_attr_max_out_io,
-       &dev_attr_max_devices,
-       &dev_attr_max_sg_list,
-       &dev_attr_sas_spec_support,
-       &dev_attr_logging_level,
-       &dev_attr_event_log_size,
-       &dev_attr_host_sas_address,
-       &dev_attr_bios_version,
-       &dev_attr_ib_log,
-       &dev_attr_ob_log,
-       &dev_attr_ila_version,
-       &dev_attr_inc_fw_ver,
-       &dev_attr_ctl_mpi_state,
-       &dev_attr_ctl_hmi_error,
-       &dev_attr_ctl_raae_count,
-       &dev_attr_ctl_iop0_count,
-       &dev_attr_ctl_iop1_count,
+static struct attribute *pm8001_host_attrs[] = {
+       &dev_attr_interface_rev.attr,
+       &dev_attr_controller_fatal_error.attr,
+       &dev_attr_fw_version.attr,
+       &dev_attr_update_fw.attr,
+       &dev_attr_aap_log.attr,
+       &dev_attr_iop_log.attr,
+       &dev_attr_fatal_log.attr,
+       &dev_attr_non_fatal_log.attr,
+       &dev_attr_non_fatal_count.attr,
+       &dev_attr_gsm_log.attr,
+       &dev_attr_max_out_io.attr,
+       &dev_attr_max_devices.attr,
+       &dev_attr_max_sg_list.attr,
+       &dev_attr_sas_spec_support.attr,
+       &dev_attr_logging_level.attr,
+       &dev_attr_event_log_size.attr,
+       &dev_attr_host_sas_address.attr,
+       &dev_attr_bios_version.attr,
+       &dev_attr_ib_log.attr,
+       &dev_attr_ob_log.attr,
+       &dev_attr_ila_version.attr,
+       &dev_attr_inc_fw_ver.attr,
+       &dev_attr_ctl_mpi_state.attr,
+       &dev_attr_ctl_hmi_error.attr,
+       &dev_attr_ctl_raae_count.attr,
+       &dev_attr_ctl_iop0_count.attr,
+       &dev_attr_ctl_iop1_count.attr,
        NULL,
 };
 
+static const struct attribute_group pm8001_host_attr_group = {
+       .attrs = pm8001_host_attrs
+};
+
+const struct attribute_group *pm8001_host_groups[] = {
+       &pm8001_host_attr_group,
+       NULL
+};
index 7082fec..bed8cc1 100644 (file)
@@ -107,7 +107,7 @@ static struct scsi_host_template pm8001_sht = {
 #ifdef CONFIG_COMPAT
        .compat_ioctl           = sas_ioctl,
 #endif
-       .shost_attrs            = pm8001_host_attrs,
+       .shost_groups           = pm8001_host_groups,
        .track_queue_depth      = 1,
 };
 
index 7e99976..83eec16 100644 (file)
@@ -733,7 +733,7 @@ ssize_t pm8001_get_gsm_dump(struct device *cdev, u32, char *buf);
 int pm80xx_fatal_errors(struct pm8001_hba_info *pm8001_ha);
 void pm8001_free_dev(struct pm8001_device *pm8001_dev);
 /* ctl shared API */
-extern struct device_attribute *pm8001_host_attrs[];
+extern const struct attribute_group *pm8001_host_groups[];
 
 static inline void
 pm8001_ccb_task_free_done(struct pm8001_hba_info *pm8001_ha,