diff mbox series

[v2,30/46] scsi: mvsas: Switch to attribute groups

Message ID 20211007211852.256007-31-bvanassche@acm.org (mailing list archive)
State Superseded
Headers show
Series Register SCSI sysfs attributes earlier | expand

Commit Message

Bart Van Assche Oct. 7, 2021, 9:18 p.m. UTC
struct device supports attribute groups directly but does not support
struct device_attribute directly. Hence switch to attribute groups.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/mvsas/mv_init.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c
index f18dd9703595..34fe54a6050f 100644
--- a/drivers/scsi/mvsas/mv_init.c
+++ b/drivers/scsi/mvsas/mv_init.c
@@ -25,7 +25,7 @@  static const struct mvs_chip_info mvs_chips[] = {
 	[chip_1320] =	{ 2, 4, 0x800, 17, 64, 8,  9, &mvs_94xx_dispatch, },
 };
 
-static struct device_attribute *mvst_host_attrs[];
+static const struct attribute_group *mvst_host_attr_groups[];
 
 #define SOC_SAS_NUM 2
 
@@ -52,7 +52,7 @@  static struct scsi_host_template mvs_sht = {
 #ifdef CONFIG_COMPAT
 	.compat_ioctl		= sas_ioctl,
 #endif
-	.shost_attrs		= mvst_host_attrs,
+	.shost_groups		= mvst_host_attr_groups,
 	.track_queue_depth	= 1,
 };
 
@@ -773,12 +773,21 @@  static void __exit mvs_exit(void)
 	sas_release_transport(mvs_stt);
 }
 
-static struct device_attribute *mvst_host_attrs[] = {
-	&dev_attr_driver_version,
-	&dev_attr_interrupt_coalescing,
+static struct attribute *mvst_host_attrs[] = {
+	&dev_attr_driver_version.attr,
+	&dev_attr_interrupt_coalescing.attr,
 	NULL,
 };
 
+static const struct attribute_group mvst_host_attr_group = {
+	.attrs = mvst_host_attrs
+};
+
+static const struct attribute_group *mvst_host_attr_groups[] = {
+	&mvst_host_attr_group,
+	NULL
+};
+
 module_init(mvs_init);
 module_exit(mvs_exit);