Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: hisi_sas: 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-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>

authored by

Bart Van Assche and committed by
Martin K. Petersen
62ac8ccb d6ddcd8b

+18 -12
+5 -3
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
··· 1742 1742 return 0; 1743 1743 } 1744 1744 1745 - static struct device_attribute *host_attrs_v1_hw[] = { 1746 - &dev_attr_phy_event_threshold, 1745 + static struct attribute *host_v1_hw_attrs[] = { 1746 + &dev_attr_phy_event_threshold.attr, 1747 1747 NULL 1748 1748 }; 1749 + 1750 + ATTRIBUTE_GROUPS(host_v1_hw); 1749 1751 1750 1752 static struct scsi_host_template sht_v1_hw = { 1751 1753 .name = DRV_NAME, ··· 1772 1770 #ifdef CONFIG_COMPAT 1773 1771 .compat_ioctl = sas_ioctl, 1774 1772 #endif 1775 - .shost_attrs = host_attrs_v1_hw, 1773 + .shost_groups = host_v1_hw_groups, 1776 1774 .host_reset = hisi_sas_host_reset, 1777 1775 }; 1778 1776
+5 -3
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
··· 3531 3531 3532 3532 } 3533 3533 3534 - static struct device_attribute *host_attrs_v2_hw[] = { 3535 - &dev_attr_phy_event_threshold, 3534 + static struct attribute *host_v2_hw_attrs[] = { 3535 + &dev_attr_phy_event_threshold.attr, 3536 3536 NULL 3537 3537 }; 3538 + 3539 + ATTRIBUTE_GROUPS(host_v2_hw); 3538 3540 3539 3541 static int map_queues_v2_hw(struct Scsi_Host *shost) 3540 3542 { ··· 3581 3579 #ifdef CONFIG_COMPAT 3582 3580 .compat_ioctl = sas_ioctl, 3583 3581 #endif 3584 - .shost_attrs = host_attrs_v2_hw, 3582 + .shost_groups = host_v2_hw_groups, 3585 3583 .host_reset = hisi_sas_host_reset, 3586 3584 .map_queues = map_queues_v2_hw, 3587 3585 .host_tagset = 1,
+8 -6
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
··· 2766 2766 return 0; 2767 2767 } 2768 2768 2769 - static struct device_attribute *host_attrs_v3_hw[] = { 2770 - &dev_attr_phy_event_threshold, 2771 - &dev_attr_intr_conv_v3_hw, 2772 - &dev_attr_intr_coal_ticks_v3_hw, 2773 - &dev_attr_intr_coal_count_v3_hw, 2769 + static struct attribute *host_v3_hw_attrs[] = { 2770 + &dev_attr_phy_event_threshold.attr, 2771 + &dev_attr_intr_conv_v3_hw.attr, 2772 + &dev_attr_intr_coal_ticks_v3_hw.attr, 2773 + &dev_attr_intr_coal_count_v3_hw.attr, 2774 2774 NULL 2775 2775 }; 2776 + 2777 + ATTRIBUTE_GROUPS(host_v3_hw); 2776 2778 2777 2779 #define HISI_SAS_DEBUGFS_REG(x) {#x, x} 2778 2780 ··· 3160 3158 #ifdef CONFIG_COMPAT 3161 3159 .compat_ioctl = sas_ioctl, 3162 3160 #endif 3163 - .shost_attrs = host_attrs_v3_hw, 3161 + .shost_groups = host_v3_hw_groups, 3164 3162 .tag_alloc_policy = BLK_TAG_ALLOC_RR, 3165 3163 .host_reset = hisi_sas_host_reset, 3166 3164 .host_tagset = 1,