aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2005-04-29 02:22:00 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-20 18:15:02 -0400
commitc76d0abd07a9c9cf72bbb5b641e1e97f92ea8f3e (patch)
treec5f3c752031dfb8b7c5a624d06b129661eec5665 /fs/sysfs
parentd48593bf208e0d046c35fb0707ae5b23fef8c4ff (diff)
[PATCH] sysfs: if show/store is missing return -EIO
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>
Diffstat (limited to 'fs/sysfs')
-rw-r--r--fs/sysfs/bin.c4
-rw-r--r--fs/sysfs/file.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
index d4aaa88d0214..78899eeab974 100644
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@ -25,7 +25,7 @@ fill_read(struct dentry *dentry, char *buffer, loff_t off, size_t count)
25 struct kobject * kobj = to_kobj(dentry->d_parent); 25 struct kobject * kobj = to_kobj(dentry->d_parent);
26 26
27 if (!attr->read) 27 if (!attr->read)
28 return -EINVAL; 28 return -EIO;
29 29
30 return attr->read(kobj, buffer, off, count); 30 return attr->read(kobj, buffer, off, count);
31} 31}
@@ -71,7 +71,7 @@ flush_write(struct dentry *dentry, char *buffer, loff_t offset, size_t count)
71 struct kobject *kobj = to_kobj(dentry->d_parent); 71 struct kobject *kobj = to_kobj(dentry->d_parent);
72 72
73 if (!attr->write) 73 if (!attr->write)
74 return -EINVAL; 74 return -EIO;
75 75
76 return attr->write(kobj, buffer, offset, count); 76 return attr->write(kobj, buffer, offset, count);
77} 77}
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 364208071e17..1481cae7d99a 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -23,7 +23,7 @@ subsys_attr_show(struct kobject * kobj, struct attribute * attr, char * page)
23{ 23{
24 struct subsystem * s = to_subsys(kobj); 24 struct subsystem * s = to_subsys(kobj);
25 struct subsys_attribute * sattr = to_sattr(attr); 25 struct subsys_attribute * sattr = to_sattr(attr);
26 ssize_t ret = 0; 26 ssize_t ret = -EIO;
27 27
28 if (sattr->show) 28 if (sattr->show)
29 ret = sattr->show(s,page); 29 ret = sattr->show(s,page);
@@ -36,7 +36,7 @@ subsys_attr_store(struct kobject * kobj, struct attribute * attr,
36{ 36{
37 struct subsystem * s = to_subsys(kobj); 37 struct subsystem * s = to_subsys(kobj);
38 struct subsys_attribute * sattr = to_sattr(attr); 38 struct subsys_attribute * sattr = to_sattr(attr);
39 ssize_t ret = 0; 39 ssize_t ret = -EIO;
40 40
41 if (sattr->store) 41 if (sattr->store)
42 ret = sattr->store(s,page,count); 42 ret = sattr->store(s,page,count);