aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/uio/uio.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-24 18:05:23 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-24 18:39:05 -0400
commitc9dce927e96c002856ac93b3a43115c33b6c1a74 (patch)
tree8d831024d5db05c03df9c59a92c2ab464d3f33a4 /drivers/uio/uio.c
parent899826f16a034f1ab6d23cd5b60cd113eaefad19 (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.c22
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
227static ssize_t show_name(struct device *dev, 227static 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}
233static DEVICE_ATTR_RO(name);
233 234
234static ssize_t show_version(struct device *dev, 235static 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}
241static DEVICE_ATTR_RO(version);
240 242
241static ssize_t show_event(struct device *dev, 243static 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}
249static DEVICE_ATTR_RO(event);
247 250
248static struct device_attribute uio_class_attributes[] = { 251static 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};
257ATTRIBUTE_GROUPS(uio);
254 258
255/* UIO class infrastructure */ 259/* UIO class infrastructure */
256static struct class uio_class = { 260static 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/*