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

scsi: cxlflash: 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-19-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
780c6789 623cf762

+22 -18
+22 -18
drivers/scsi/cxlflash/main.c
··· 3103 3103 static DEVICE_ATTR_RW(num_hwqs); 3104 3104 static DEVICE_ATTR_RW(hwq_mode); 3105 3105 3106 - static struct device_attribute *cxlflash_host_attrs[] = { 3107 - &dev_attr_port0, 3108 - &dev_attr_port1, 3109 - &dev_attr_port2, 3110 - &dev_attr_port3, 3111 - &dev_attr_lun_mode, 3112 - &dev_attr_ioctl_version, 3113 - &dev_attr_port0_lun_table, 3114 - &dev_attr_port1_lun_table, 3115 - &dev_attr_port2_lun_table, 3116 - &dev_attr_port3_lun_table, 3117 - &dev_attr_irqpoll_weight, 3118 - &dev_attr_num_hwqs, 3119 - &dev_attr_hwq_mode, 3106 + static struct attribute *cxlflash_host_attrs[] = { 3107 + &dev_attr_port0.attr, 3108 + &dev_attr_port1.attr, 3109 + &dev_attr_port2.attr, 3110 + &dev_attr_port3.attr, 3111 + &dev_attr_lun_mode.attr, 3112 + &dev_attr_ioctl_version.attr, 3113 + &dev_attr_port0_lun_table.attr, 3114 + &dev_attr_port1_lun_table.attr, 3115 + &dev_attr_port2_lun_table.attr, 3116 + &dev_attr_port3_lun_table.attr, 3117 + &dev_attr_irqpoll_weight.attr, 3118 + &dev_attr_num_hwqs.attr, 3119 + &dev_attr_hwq_mode.attr, 3120 3120 NULL 3121 3121 }; 3122 + 3123 + ATTRIBUTE_GROUPS(cxlflash_host); 3122 3124 3123 3125 /* 3124 3126 * Device attributes 3125 3127 */ 3126 3128 static DEVICE_ATTR_RO(mode); 3127 3129 3128 - static struct device_attribute *cxlflash_dev_attrs[] = { 3129 - &dev_attr_mode, 3130 + static struct attribute *cxlflash_dev_attrs[] = { 3131 + &dev_attr_mode.attr, 3130 3132 NULL 3131 3133 }; 3134 + 3135 + ATTRIBUTE_GROUPS(cxlflash_dev); 3132 3136 3133 3137 /* 3134 3138 * Host template ··· 3154 3150 .this_id = -1, 3155 3151 .sg_tablesize = 1, /* No scatter gather support */ 3156 3152 .max_sectors = CXLFLASH_MAX_SECTORS, 3157 - .shost_attrs = cxlflash_host_attrs, 3158 - .sdev_attrs = cxlflash_dev_attrs, 3153 + .shost_groups = cxlflash_host_groups, 3154 + .sdev_groups = cxlflash_dev_groups, 3159 3155 }; 3160 3156 3161 3157 /*