Skip to content

Commit 92a3e66

Browse files
committed
SCSI: OSD: convert class code to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups should be used instead. This converts the scsi osd class code to use the correct field. Acked-by: Boaz Harrosh <bharrosh@panasas.com> Cc: Benny Halevy <bhalevy@tonian.com> Cc: James E.J. Bottomley <JBottomley@parallels.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent af01da0 commit 92a3e66

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

‎drivers/scsi/osd/osd_uld.c‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ static ssize_t osdname_show(struct device *dev, struct device_attribute *attr,
107107
class_dev);
108108
return sprintf(buf, "%s\n", ould->odi.osdname);
109109
}
110+
static DEVICE_ATTR_RO(osdname);
110111

111112
static ssize_t systemid_show(struct device *dev, struct device_attribute *attr,
112113
char *buf)
@@ -117,17 +118,19 @@ static ssize_t systemid_show(struct device *dev, struct device_attribute *attr,
117118
memcpy(buf, ould->odi.systemid, ould->odi.systemid_len);
118119
return ould->odi.systemid_len;
119120
}
121+
static DEVICE_ATTR_RO(systemid);
120122

121-
static struct device_attribute osd_uld_attrs[] = {
122-
__ATTR(osdname, S_IRUGO, osdname_show, NULL),
123-
__ATTR(systemid, S_IRUGO, systemid_show, NULL),
124-
__ATTR_NULL,
123+
static struct attribute *osd_uld_attrs[] = {
124+
&dev_attr_osdname.attr,
125+
&dev_attr_systemid.attr,
126+
NULL,
125127
};
128+
ATTRIBUTE_GROUPS(osd_uld);
126129

127130
static struct class osd_uld_class = {
128131
.owner = THIS_MODULE,
129132
.name = "scsi_osd",
130-
.dev_attrs = osd_uld_attrs,
133+
.dev_groups = osd_uld_groups,
131134
};
132135

133136
/*

0 commit comments

Comments
 (0)