diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-24 18:05:06 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-24 18:39:04 -0400 |
commit | 62e13505b4eff7a0e94bdcb1f4fd76cbe4a96ff1 (patch) | |
tree | 8f82a30417c0804baa358af028cbacf9a5f4725c /drivers/char | |
parent | a332eeac4d196f927893b21f0d923b89cf545acc (diff) |
bsr: convert bsr_class to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the bsr bsr_class code to use
the correct field.
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/bsr.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c index 97467053a01b..0671e45daa57 100644 --- a/drivers/char/bsr.c +++ b/drivers/char/bsr.c | |||
@@ -95,6 +95,7 @@ bsr_size_show(struct device *dev, struct device_attribute *attr, char *buf) | |||
95 | struct bsr_dev *bsr_dev = dev_get_drvdata(dev); | 95 | struct bsr_dev *bsr_dev = dev_get_drvdata(dev); |
96 | return sprintf(buf, "%u\n", bsr_dev->bsr_bytes); | 96 | return sprintf(buf, "%u\n", bsr_dev->bsr_bytes); |
97 | } | 97 | } |
98 | static DEVICE_ATTR_RO(bsr_size); | ||
98 | 99 | ||
99 | static ssize_t | 100 | static ssize_t |
100 | bsr_stride_show(struct device *dev, struct device_attribute *attr, char *buf) | 101 | bsr_stride_show(struct device *dev, struct device_attribute *attr, char *buf) |
@@ -102,20 +103,23 @@ bsr_stride_show(struct device *dev, struct device_attribute *attr, char *buf) | |||
102 | struct bsr_dev *bsr_dev = dev_get_drvdata(dev); | 103 | struct bsr_dev *bsr_dev = dev_get_drvdata(dev); |
103 | return sprintf(buf, "%u\n", bsr_dev->bsr_stride); | 104 | return sprintf(buf, "%u\n", bsr_dev->bsr_stride); |
104 | } | 105 | } |
106 | static DEVICE_ATTR_RO(bsr_stride); | ||
105 | 107 | ||
106 | static ssize_t | 108 | static ssize_t |
107 | bsr_len_show(struct device *dev, struct device_attribute *attr, char *buf) | 109 | bsr_length_show(struct device *dev, struct device_attribute *attr, char *buf) |
108 | { | 110 | { |
109 | struct bsr_dev *bsr_dev = dev_get_drvdata(dev); | 111 | struct bsr_dev *bsr_dev = dev_get_drvdata(dev); |
110 | return sprintf(buf, "%llu\n", bsr_dev->bsr_len); | 112 | return sprintf(buf, "%llu\n", bsr_dev->bsr_len); |
111 | } | 113 | } |
114 | static DEVICE_ATTR_RO(bsr_length); | ||
112 | 115 | ||
113 | static struct device_attribute bsr_dev_attrs[] = { | 116 | static struct attribute *bsr_dev_attrs[] = { |
114 | __ATTR(bsr_size, S_IRUGO, bsr_size_show, NULL), | 117 | &dev_attr_bsr_size.attr, |
115 | __ATTR(bsr_stride, S_IRUGO, bsr_stride_show, NULL), | 118 | &dev_attr_bsr_stride.attr, |
116 | __ATTR(bsr_length, S_IRUGO, bsr_len_show, NULL), | 119 | &dev_attr_bsr_length.attr, |
117 | __ATTR_NULL | 120 | NULL, |
118 | }; | 121 | }; |
122 | ATTRIBUTE_GROUPS(bsr_dev); | ||
119 | 123 | ||
120 | static int bsr_mmap(struct file *filp, struct vm_area_struct *vma) | 124 | static int bsr_mmap(struct file *filp, struct vm_area_struct *vma) |
121 | { | 125 | { |
@@ -308,7 +312,7 @@ static int __init bsr_init(void) | |||
308 | ret = PTR_ERR(bsr_class); | 312 | ret = PTR_ERR(bsr_class); |
309 | goto out_err_1; | 313 | goto out_err_1; |
310 | } | 314 | } |
311 | bsr_class->dev_attrs = bsr_dev_attrs; | 315 | bsr_class->dev_groups = bsr_dev_groups; |
312 | 316 | ||
313 | ret = alloc_chrdev_region(&bsr_dev, 0, BSR_MAX_DEVS, "bsr"); | 317 | ret = alloc_chrdev_region(&bsr_dev, 0, BSR_MAX_DEVS, "bsr"); |
314 | bsr_major = MAJOR(bsr_dev); | 318 | bsr_major = MAJOR(bsr_dev); |