mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
af01da0e02
commit
92a3e661bf
|
@ -107,6 +107,7 @@ static ssize_t osdname_show(struct device *dev, struct device_attribute *attr,
|
||||||
class_dev);
|
class_dev);
|
||||||
return sprintf(buf, "%s\n", ould->odi.osdname);
|
return sprintf(buf, "%s\n", ould->odi.osdname);
|
||||||
}
|
}
|
||||||
|
static DEVICE_ATTR_RO(osdname);
|
||||||
|
|
||||||
static ssize_t systemid_show(struct device *dev, struct device_attribute *attr,
|
static ssize_t systemid_show(struct device *dev, struct device_attribute *attr,
|
||||||
char *buf)
|
char *buf)
|
||||||
|
@ -117,17 +118,19 @@ static ssize_t systemid_show(struct device *dev, struct device_attribute *attr,
|
||||||
memcpy(buf, ould->odi.systemid, ould->odi.systemid_len);
|
memcpy(buf, ould->odi.systemid, ould->odi.systemid_len);
|
||||||
return ould->odi.systemid_len;
|
return ould->odi.systemid_len;
|
||||||
}
|
}
|
||||||
|
static DEVICE_ATTR_RO(systemid);
|
||||||
|
|
||||||
static struct device_attribute osd_uld_attrs[] = {
|
static struct attribute *osd_uld_attrs[] = {
|
||||||
__ATTR(osdname, S_IRUGO, osdname_show, NULL),
|
&dev_attr_osdname.attr,
|
||||||
__ATTR(systemid, S_IRUGO, systemid_show, NULL),
|
&dev_attr_systemid.attr,
|
||||||
__ATTR_NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
ATTRIBUTE_GROUPS(osd_uld);
|
||||||
|
|
||||||
static struct class osd_uld_class = {
|
static struct class osd_uld_class = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.name = "scsi_osd",
|
.name = "scsi_osd",
|
||||||
.dev_attrs = osd_uld_attrs,
|
.dev_groups = osd_uld_groups,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue