diff mbox series

[v2,26/46] scsi: isci: Switch to attribute groups

Message ID 20211007211852.256007-27-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/isci/init.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c
index ffd33e5decae..ae7b6baade99 100644
--- a/drivers/scsi/isci/init.c
+++ b/drivers/scsi/isci/init.c
@@ -142,8 +142,17 @@  static ssize_t isci_show_id(struct device *dev, struct device_attribute *attr, c
 
 static DEVICE_ATTR(isci_id, S_IRUGO, isci_show_id, NULL);
 
-static struct device_attribute *isci_host_attrs[] = {
-	&dev_attr_isci_id,
+static struct attribute *isci_host_attrs[] = {
+	&dev_attr_isci_id.attr,
+	NULL
+};
+
+static const struct attribute_group isci_host_attr_group = {
+	.attrs = isci_host_attrs
+};
+
+static const struct attribute_group *isci_host_attr_groups[] = {
+	&isci_host_attr_group,
 	NULL
 };
 
@@ -173,7 +182,7 @@  static struct scsi_host_template isci_sht = {
 #ifdef CONFIG_COMPAT
 	.compat_ioctl			= sas_ioctl,
 #endif
-	.shost_attrs			= isci_host_attrs,
+	.shost_groups			= isci_host_attr_groups,
 	.track_queue_depth		= 1,
 };