]> err.no Git - linux-2.6/commitdiff
[PATCH] sysfs: if show/store is missing return -EIO
authorDmitry Torokhov <dtor_core@ameritech.net>
Fri, 29 Apr 2005 06:22:00 +0000 (01:22 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 20 Jun 2005 22:15:02 +0000 (15:15 -0700)
sysfs: if attribute does not implement show or store method
       read/write should return -EIO instead of 0 or -EINVAL.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/sysfs/bin.c
fs/sysfs/file.c

index d4aaa88d02144b4f6618d8f79dbd76aea6efe16a..78899eeab9742c8e35b8c8a68a43054c0fd9c5a9 100644 (file)
@@ -25,7 +25,7 @@ fill_read(struct dentry *dentry, char *buffer, loff_t off, size_t count)
        struct kobject * kobj = to_kobj(dentry->d_parent);
 
        if (!attr->read)
-               return -EINVAL;
+               return -EIO;
 
        return attr->read(kobj, buffer, off, count);
 }
@@ -71,7 +71,7 @@ flush_write(struct dentry *dentry, char *buffer, loff_t offset, size_t count)
        struct kobject *kobj = to_kobj(dentry->d_parent);
 
        if (!attr->write)
-               return -EINVAL;
+               return -EIO;
 
        return attr->write(kobj, buffer, offset, count);
 }
index 364208071e1747d155b3eb6521d364c30b53bcd5..1481cae7d99ad0b882f27b610bb7326c3c4d41c8 100644 (file)
@@ -23,7 +23,7 @@ subsys_attr_show(struct kobject * kobj, struct attribute * attr, char * page)
 {
        struct subsystem * s = to_subsys(kobj);
        struct subsys_attribute * sattr = to_sattr(attr);
-       ssize_t ret = 0;
+       ssize_t ret = -EIO;
 
        if (sattr->show)
                ret = sattr->show(s,page);
@@ -36,7 +36,7 @@ subsys_attr_store(struct kobject * kobj, struct attribute * attr,
 {
        struct subsystem * s = to_subsys(kobj);
        struct subsys_attribute * sattr = to_sattr(attr);
-       ssize_t ret = 0;
+       ssize_t ret = -EIO;
 
        if (sattr->store)
                ret = sattr->store(s,page,count);