aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/uio/uio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/uio/uio.c')
-rw-r--r--drivers/uio/uio.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index bc774cce0a4d..8132288920b2 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -229,10 +229,7 @@ static ssize_t show_name(struct device *dev,
229 struct device_attribute *attr, char *buf) 229 struct device_attribute *attr, char *buf)
230{ 230{
231 struct uio_device *idev = dev_get_drvdata(dev); 231 struct uio_device *idev = dev_get_drvdata(dev);
232 if (idev) 232 return sprintf(buf, "%s\n", idev->info->name);
233 return sprintf(buf, "%s\n", idev->info->name);
234 else
235 return -ENODEV;
236} 233}
237static DEVICE_ATTR(name, S_IRUGO, show_name, NULL); 234static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);
238 235
@@ -240,10 +237,7 @@ static ssize_t show_version(struct device *dev,
240 struct device_attribute *attr, char *buf) 237 struct device_attribute *attr, char *buf)
241{ 238{
242 struct uio_device *idev = dev_get_drvdata(dev); 239 struct uio_device *idev = dev_get_drvdata(dev);
243 if (idev) 240 return sprintf(buf, "%s\n", idev->info->version);
244 return sprintf(buf, "%s\n", idev->info->version);
245 else
246 return -ENODEV;
247} 241}
248static DEVICE_ATTR(version, S_IRUGO, show_version, NULL); 242static DEVICE_ATTR(version, S_IRUGO, show_version, NULL);
249 243
@@ -251,11 +245,7 @@ static ssize_t show_event(struct device *dev,
251 struct device_attribute *attr, char *buf) 245 struct device_attribute *attr, char *buf)
252{ 246{
253 struct uio_device *idev = dev_get_drvdata(dev); 247 struct uio_device *idev = dev_get_drvdata(dev);
254 if (idev) 248 return sprintf(buf, "%u\n", (unsigned int)atomic_read(&idev->event));
255 return sprintf(buf, "%u\n",
256 (unsigned int)atomic_read(&idev->event));
257 else
258 return -ENODEV;
259} 249}
260static DEVICE_ATTR(event, S_IRUGO, show_event, NULL); 250static DEVICE_ATTR(event, S_IRUGO, show_event, NULL);
261 251
@@ -878,7 +868,6 @@ void uio_unregister_device(struct uio_info *info)
878 868
879 uio_dev_del_attributes(idev); 869 uio_dev_del_attributes(idev);
880 870
881 dev_set_drvdata(idev->dev, NULL);
882 device_destroy(uio_class, MKDEV(uio_major, idev->minor)); 871 device_destroy(uio_class, MKDEV(uio_major, idev->minor));
883 kfree(idev); 872 kfree(idev);
884 873