diff mbox series

[v2,03/46] firewire: sbp2: Switch to attribute groups

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

Patch

diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c
index 4d5054211550..f0fcd81402e3 100644
--- a/drivers/firewire/sbp2.c
+++ b/drivers/firewire/sbp2.c
@@ -1578,8 +1578,17 @@  static ssize_t sbp2_sysfs_ieee1394_id_show(struct device *dev,
 
 static DEVICE_ATTR(ieee1394_id, S_IRUGO, sbp2_sysfs_ieee1394_id_show, NULL);
 
-static struct device_attribute *sbp2_scsi_sysfs_attrs[] = {
-	&dev_attr_ieee1394_id,
+static struct attribute *sbp2_scsi_sysfs_attrs[] = {
+	&dev_attr_ieee1394_id.attr,
+	NULL
+};
+
+static const struct attribute_group sbp2_scsi_sysfs_attr_group = {
+	.attrs = sbp2_scsi_sysfs_attrs
+};
+
+static const struct attribute_group *sbp2_scsi_sysfs_attr_groups[] = {
+	&sbp2_scsi_sysfs_attr_group,
 	NULL
 };
 
@@ -1595,7 +1604,7 @@  static struct scsi_host_template scsi_driver_template = {
 	.sg_tablesize		= SG_ALL,
 	.max_segment_size	= SBP2_MAX_SEG_SIZE,
 	.can_queue		= 1,
-	.sdev_attrs		= sbp2_scsi_sysfs_attrs,
+	.sdev_groups		= sbp2_scsi_sysfs_attr_groups,
 };
 
 MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>");