scsi: hisi_sas: Switch to attribute groups
authorBart Van Assche <bvanassche@acm.org>
Tue, 12 Oct 2021 23:35:32 +0000 (16:35 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 17 Oct 2021 01:45:55 +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-21-bvanassche@acm.org
Acked-by: John Garry <john.garry@huawei.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

index b4951ff..3059d19 100644 (file)
@@ -1742,11 +1742,13 @@ static int hisi_sas_v1_init(struct hisi_hba *hisi_hba)
        return 0;
 }
 
-static struct device_attribute *host_attrs_v1_hw[] = {
-       &dev_attr_phy_event_threshold,
+static struct attribute *host_v1_hw_attrs[] = {
+       &dev_attr_phy_event_threshold.attr,
        NULL
 };
 
+ATTRIBUTE_GROUPS(host_v1_hw);
+
 static struct scsi_host_template sht_v1_hw = {
        .name                   = DRV_NAME,
        .proc_name              = DRV_NAME,
@@ -1770,7 +1772,7 @@ static struct scsi_host_template sht_v1_hw = {
 #ifdef CONFIG_COMPAT
        .compat_ioctl           = sas_ioctl,
 #endif
-       .shost_attrs            = host_attrs_v1_hw,
+       .shost_groups           = host_v1_hw_groups,
        .host_reset             = hisi_sas_host_reset,
 };
 
index 45eb0b9..64ed3e4 100644 (file)
@@ -3531,11 +3531,13 @@ static void wait_cmds_complete_timeout_v2_hw(struct hisi_hba *hisi_hba,
 
 }
 
-static struct device_attribute *host_attrs_v2_hw[] = {
-       &dev_attr_phy_event_threshold,
+static struct attribute *host_v2_hw_attrs[] = {
+       &dev_attr_phy_event_threshold.attr,
        NULL
 };
 
+ATTRIBUTE_GROUPS(host_v2_hw);
+
 static int map_queues_v2_hw(struct Scsi_Host *shost)
 {
        struct hisi_hba *hisi_hba = shost_priv(shost);
@@ -3579,7 +3581,7 @@ static struct scsi_host_template sht_v2_hw = {
 #ifdef CONFIG_COMPAT
        .compat_ioctl           = sas_ioctl,
 #endif
-       .shost_attrs            = host_attrs_v2_hw,
+       .shost_groups           = host_v2_hw_groups,
        .host_reset             = hisi_sas_host_reset,
        .map_queues             = map_queues_v2_hw,
        .host_tagset            = 1,
index 2082b06..9ae47d1 100644 (file)
@@ -2766,14 +2766,16 @@ static int slave_configure_v3_hw(struct scsi_device *sdev)
        return 0;
 }
 
-static struct device_attribute *host_attrs_v3_hw[] = {
-       &dev_attr_phy_event_threshold,
-       &dev_attr_intr_conv_v3_hw,
-       &dev_attr_intr_coal_ticks_v3_hw,
-       &dev_attr_intr_coal_count_v3_hw,
+static struct attribute *host_v3_hw_attrs[] = {
+       &dev_attr_phy_event_threshold.attr,
+       &dev_attr_intr_conv_v3_hw.attr,
+       &dev_attr_intr_coal_ticks_v3_hw.attr,
+       &dev_attr_intr_coal_count_v3_hw.attr,
        NULL
 };
 
+ATTRIBUTE_GROUPS(host_v3_hw);
+
 #define HISI_SAS_DEBUGFS_REG(x) {#x, x}
 
 struct hisi_sas_debugfs_reg_lu {
@@ -3158,7 +3160,7 @@ static struct scsi_host_template sht_v3_hw = {
 #ifdef CONFIG_COMPAT
        .compat_ioctl           = sas_ioctl,
 #endif
-       .shost_attrs            = host_attrs_v3_hw,
+       .shost_groups           = host_v3_hw_groups,
        .tag_alloc_policy       = BLK_TAG_ALLOC_RR,
        .host_reset             = hisi_sas_host_reset,
        .host_tagset            = 1,