cuse: 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 cuse class code to use the correct field. Acked-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3499116b91
commit
4183fb9503
|
@ -568,6 +568,7 @@ static ssize_t cuse_class_waiting_show(struct device *dev,
|
||||||
|
|
||||||
return sprintf(buf, "%d\n", atomic_read(&cc->fc.num_waiting));
|
return sprintf(buf, "%d\n", atomic_read(&cc->fc.num_waiting));
|
||||||
}
|
}
|
||||||
|
static DEVICE_ATTR(waiting, S_IFREG | 0400, cuse_class_waiting_show, NULL);
|
||||||
|
|
||||||
static ssize_t cuse_class_abort_store(struct device *dev,
|
static ssize_t cuse_class_abort_store(struct device *dev,
|
||||||
struct device_attribute *attr,
|
struct device_attribute *attr,
|
||||||
|
@ -578,12 +579,14 @@ static ssize_t cuse_class_abort_store(struct device *dev,
|
||||||
fuse_abort_conn(&cc->fc);
|
fuse_abort_conn(&cc->fc);
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
static DEVICE_ATTR(abort, S_IFREG | 0200, NULL, cuse_class_abort_store);
|
||||||
|
|
||||||
static struct device_attribute cuse_class_dev_attrs[] = {
|
static struct attribute *cuse_class_dev_attrs[] = {
|
||||||
__ATTR(waiting, S_IFREG | 0400, cuse_class_waiting_show, NULL),
|
&dev_attr_waiting.attr,
|
||||||
__ATTR(abort, S_IFREG | 0200, NULL, cuse_class_abort_store),
|
&dev_attr_abort.attr,
|
||||||
{ }
|
NULL,
|
||||||
};
|
};
|
||||||
|
ATTRIBUTE_GROUPS(cuse_class_dev);
|
||||||
|
|
||||||
static struct miscdevice cuse_miscdev = {
|
static struct miscdevice cuse_miscdev = {
|
||||||
.minor = MISC_DYNAMIC_MINOR,
|
.minor = MISC_DYNAMIC_MINOR,
|
||||||
|
@ -609,7 +612,7 @@ static int __init cuse_init(void)
|
||||||
if (IS_ERR(cuse_class))
|
if (IS_ERR(cuse_class))
|
||||||
return PTR_ERR(cuse_class);
|
return PTR_ERR(cuse_class);
|
||||||
|
|
||||||
cuse_class->dev_attrs = cuse_class_dev_attrs;
|
cuse_class->dev_groups = cuse_class_dev_groups;
|
||||||
|
|
||||||
rc = misc_register(&cuse_miscdev);
|
rc = misc_register(&cuse_miscdev);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
|
|
Loading…
Reference in New Issue