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

scsi: bnx2i: 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-17-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
eb78ac7a c3dd11d8

+14 -5
+1 -1
drivers/scsi/bnx2i/bnx2i.h
··· 795 795 extern unsigned int sq_size; 796 796 extern unsigned int rq_size; 797 797 798 - extern struct device_attribute *bnx2i_dev_attributes[]; 798 + extern const struct attribute_group *bnx2i_dev_groups[]; 799 799 800 800 801 801
+1 -1
drivers/scsi/bnx2i/bnx2i_iscsi.c
··· 2266 2266 .cmd_per_lun = 128, 2267 2267 .this_id = -1, 2268 2268 .sg_tablesize = ISCSI_MAX_BDS_PER_CMD, 2269 - .shost_attrs = bnx2i_dev_attributes, 2269 + .shost_groups = bnx2i_dev_groups, 2270 2270 .track_queue_depth = 1, 2271 2271 }; 2272 2272
+12 -3
drivers/scsi/bnx2i/bnx2i_sysfs.c
··· 142 142 static DEVICE_ATTR(num_ccell, S_IRUGO | S_IWUSR, 143 143 bnx2i_show_ccell_info, bnx2i_set_ccell_info); 144 144 145 - struct device_attribute *bnx2i_dev_attributes[] = { 146 - &dev_attr_sq_size, 147 - &dev_attr_num_ccell, 145 + static struct attribute *bnx2i_dev_attributes[] = { 146 + &dev_attr_sq_size.attr, 147 + &dev_attr_num_ccell.attr, 148 + NULL 149 + }; 150 + 151 + static const struct attribute_group bnx2i_dev_attr_group = { 152 + .attrs = bnx2i_dev_attributes 153 + }; 154 + 155 + const struct attribute_group *bnx2i_dev_groups[] = { 156 + &bnx2i_dev_attr_group, 148 157 NULL 149 158 };