diff options
author | Eric W. Biederman <ebiederm@aristanetworks.com> | 2010-09-14 14:36:54 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-22 13:16:43 -0400 |
commit | 70a9156bad9d9d1476df35dde582b9f411bf5914 (patch) | |
tree | e44b2b21f59375eedd0431a1ea31aa26b4f602dd /drivers/uio | |
parent | 3d4f9d76b0641b7984f95982e390927fc5998ad6 (diff) |
uio: Don't clear driver data
Currently uio sets it's driver data to NULL just as it is unregistering
attributes. sysfs maks the guaranatee that it will not call attributes
after device_destroy is called so this is unncessary and leads to lots
of unnecessary code in uio.c
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/uio')
-rw-r--r-- | drivers/uio/uio.c | 17 |
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 | } |
237 | static DEVICE_ATTR(name, S_IRUGO, show_name, NULL); | 234 | static 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 | } |
248 | static DEVICE_ATTR(version, S_IRUGO, show_version, NULL); | 242 | static 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 | } |
260 | static DEVICE_ATTR(event, S_IRUGO, show_event, NULL); | 250 | static 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 | ||