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

scsi: hpsa: 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-22-bvanassche@acm.org
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
4cd16323 62ac8ccb

+24 -20
+24 -20
drivers/scsi/hpsa.c
··· 936 936 static DEVICE_ATTR(legacy_board, S_IRUGO, 937 937 host_show_legacy_board, NULL); 938 938 939 - static struct device_attribute *hpsa_sdev_attrs[] = { 940 - &dev_attr_raid_level, 941 - &dev_attr_lunid, 942 - &dev_attr_unique_id, 943 - &dev_attr_hp_ssd_smart_path_enabled, 944 - &dev_attr_path_info, 945 - &dev_attr_sas_address, 939 + static struct attribute *hpsa_sdev_attrs[] = { 940 + &dev_attr_raid_level.attr, 941 + &dev_attr_lunid.attr, 942 + &dev_attr_unique_id.attr, 943 + &dev_attr_hp_ssd_smart_path_enabled.attr, 944 + &dev_attr_path_info.attr, 945 + &dev_attr_sas_address.attr, 946 946 NULL, 947 947 }; 948 948 949 - static struct device_attribute *hpsa_shost_attrs[] = { 950 - &dev_attr_rescan, 951 - &dev_attr_firmware_revision, 952 - &dev_attr_commands_outstanding, 953 - &dev_attr_transport_mode, 954 - &dev_attr_resettable, 955 - &dev_attr_hp_ssd_smart_path_status, 956 - &dev_attr_raid_offload_debug, 957 - &dev_attr_lockup_detected, 958 - &dev_attr_ctlr_num, 959 - &dev_attr_legacy_board, 949 + ATTRIBUTE_GROUPS(hpsa_sdev); 950 + 951 + static struct attribute *hpsa_shost_attrs[] = { 952 + &dev_attr_rescan.attr, 953 + &dev_attr_firmware_revision.attr, 954 + &dev_attr_commands_outstanding.attr, 955 + &dev_attr_transport_mode.attr, 956 + &dev_attr_resettable.attr, 957 + &dev_attr_hp_ssd_smart_path_status.attr, 958 + &dev_attr_raid_offload_debug.attr, 959 + &dev_attr_lockup_detected.attr, 960 + &dev_attr_ctlr_num.attr, 961 + &dev_attr_legacy_board.attr, 960 962 NULL, 961 963 }; 964 + 965 + ATTRIBUTE_GROUPS(hpsa_shost); 962 966 963 967 #define HPSA_NRESERVED_CMDS (HPSA_CMDS_RESERVED_FOR_DRIVER +\ 964 968 HPSA_MAX_CONCURRENT_PASSTHRUS) ··· 984 980 #ifdef CONFIG_COMPAT 985 981 .compat_ioctl = hpsa_compat_ioctl, 986 982 #endif 987 - .sdev_attrs = hpsa_sdev_attrs, 988 - .shost_attrs = hpsa_shost_attrs, 983 + .sdev_groups = hpsa_sdev_groups, 984 + .shost_groups = hpsa_shost_groups, 989 985 .max_sectors = 2048, 990 986 .no_write_same = 1, 991 987 };