diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-24 18:05:23 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-24 18:39:05 -0400 |
commit | c9dce927e96c002856ac93b3a43115c33b6c1a74 (patch) | |
tree | 8d831024d5db05c03df9c59a92c2ab464d3f33a4 /drivers/uio/uio.c | |
parent | 899826f16a034f1ab6d23cd5b60cd113eaefad19 (diff) |
UIO: 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 uio class code to use the
correct field.
Cc: Hans J. Koch <hjk@hansjkoch.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/uio/uio.c')
-rw-r--r-- | drivers/uio/uio.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index 3b96f18593b3..170a178d661a 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c | |||
@@ -224,38 +224,42 @@ static struct kobj_type portio_attr_type = { | |||
224 | .default_attrs = portio_attrs, | 224 | .default_attrs = portio_attrs, |
225 | }; | 225 | }; |
226 | 226 | ||
227 | static ssize_t show_name(struct device *dev, | 227 | static ssize_t name_show(struct device *dev, |
228 | struct device_attribute *attr, char *buf) | 228 | struct device_attribute *attr, char *buf) |
229 | { | 229 | { |
230 | struct uio_device *idev = dev_get_drvdata(dev); | 230 | struct uio_device *idev = dev_get_drvdata(dev); |
231 | return sprintf(buf, "%s\n", idev->info->name); | 231 | return sprintf(buf, "%s\n", idev->info->name); |
232 | } | 232 | } |
233 | static DEVICE_ATTR_RO(name); | ||
233 | 234 | ||
234 | static ssize_t show_version(struct device *dev, | 235 | static ssize_t version_show(struct device *dev, |
235 | struct device_attribute *attr, char *buf) | 236 | struct device_attribute *attr, char *buf) |
236 | { | 237 | { |
237 | struct uio_device *idev = dev_get_drvdata(dev); | 238 | struct uio_device *idev = dev_get_drvdata(dev); |
238 | return sprintf(buf, "%s\n", idev->info->version); | 239 | return sprintf(buf, "%s\n", idev->info->version); |
239 | } | 240 | } |
241 | static DEVICE_ATTR_RO(version); | ||
240 | 242 | ||
241 | static ssize_t show_event(struct device *dev, | 243 | static ssize_t event_show(struct device *dev, |
242 | struct device_attribute *attr, char *buf) | 244 | struct device_attribute *attr, char *buf) |
243 | { | 245 | { |
244 | struct uio_device *idev = dev_get_drvdata(dev); | 246 | struct uio_device *idev = dev_get_drvdata(dev); |
245 | return sprintf(buf, "%u\n", (unsigned int)atomic_read(&idev->event)); | 247 | return sprintf(buf, "%u\n", (unsigned int)atomic_read(&idev->event)); |
246 | } | 248 | } |
249 | static DEVICE_ATTR_RO(event); | ||
247 | 250 | ||
248 | static struct device_attribute uio_class_attributes[] = { | 251 | static struct attribute *uio_attrs[] = { |
249 | __ATTR(name, S_IRUGO, show_name, NULL), | 252 | &dev_attr_name.attr, |
250 | __ATTR(version, S_IRUGO, show_version, NULL), | 253 | &dev_attr_version.attr, |
251 | __ATTR(event, S_IRUGO, show_event, NULL), | 254 | &dev_attr_event.attr, |
252 | {} | 255 | NULL, |
253 | }; | 256 | }; |
257 | ATTRIBUTE_GROUPS(uio); | ||
254 | 258 | ||
255 | /* UIO class infrastructure */ | 259 | /* UIO class infrastructure */ |
256 | static struct class uio_class = { | 260 | static struct class uio_class = { |
257 | .name = "uio", | 261 | .name = "uio", |
258 | .dev_attrs = uio_class_attributes, | 262 | .dev_groups = uio_groups, |
259 | }; | 263 | }; |
260 | 264 | ||
261 | /* | 265 | /* |