summaryrefslogtreecommitdiff
path: root/drivers/base/bus.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2005-04-29 10:23:47 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-21 02:15:02 +0400
commit4a0c20bf8c0fe2116f8fd7d3da6122bf8a01f026 (patch)
tree48b6108a889f7cc007633c4d7d6f2c9fafe18082 /drivers/base/bus.c
parentc76d0abd07a9c9cf72bbb5b641e1e97f92ea8f3e (diff)
downloadlinux-4a0c20bf8c0fe2116f8fd7d3da6122bf8a01f026.tar.xz
[PATCH] sysfs: (driver/base) if show/store is missing return -EIO
sysfs: fix drivers/base so if an attribute doesn't implement show or store method read/write will return -EIO instead of 0. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/bus.c')
-rw-r--r--drivers/base/bus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 3cb04bb04c2b..80ce88de56fa 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -36,7 +36,7 @@ drv_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
{
struct driver_attribute * drv_attr = to_drv_attr(attr);
struct device_driver * drv = to_driver(kobj);
- ssize_t ret = 0;
+ ssize_t ret = -EIO;
if (drv_attr->show)
ret = drv_attr->show(drv, buf);
@@ -49,7 +49,7 @@ drv_attr_store(struct kobject * kobj, struct attribute * attr,
{
struct driver_attribute * drv_attr = to_drv_attr(attr);
struct device_driver * drv = to_driver(kobj);
- ssize_t ret = 0;
+ ssize_t ret = -EIO;
if (drv_attr->store)
ret = drv_attr->store(drv, buf, count);