summaryrefslogtreecommitdiff
path: root/drivers/uio
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@aristanetworks.com>2010-09-14 11:36:54 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 10:16:43 -0700
commit70a9156bad9d9d1476df35dde582b9f411bf5914 (patch)
treee44b2b21f59375eedd0431a1ea31aa26b4f602dd /drivers/uio
parent3d4f9d76b0641b7984f95982e390927fc5998ad6 (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.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,
struct device_attribute *attr, char *buf)
{
struct uio_device *idev = dev_get_drvdata(dev);
- if (idev)
- return sprintf(buf, "%s\n", idev->info->name);
- else
- return -ENODEV;
+ return sprintf(buf, "%s\n", idev->info->name);
}
static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);
@@ -240,10 +237,7 @@ static ssize_t show_version(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct uio_device *idev = dev_get_drvdata(dev);
- if (idev)
- return sprintf(buf, "%s\n", idev->info->version);
- else
- return -ENODEV;
+ return sprintf(buf, "%s\n", idev->info->version);
}
static DEVICE_ATTR(version, S_IRUGO, show_version, NULL);
@@ -251,11 +245,7 @@ static ssize_t show_event(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct uio_device *idev = dev_get_drvdata(dev);
- if (idev)
- return sprintf(buf, "%u\n",
- (unsigned int)atomic_read(&idev->event));
- else
- return -ENODEV;
+ return sprintf(buf, "%u\n", (unsigned int)atomic_read(&idev->event));
}
static DEVICE_ATTR(event, S_IRUGO, show_event, NULL);
@@ -878,7 +868,6 @@ void uio_unregister_device(struct uio_info *info)
uio_dev_del_attributes(idev);
- dev_set_drvdata(idev->dev, NULL);
device_destroy(uio_class, MKDEV(uio_major, idev->minor));
kfree(idev);