mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[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>
This commit is contained in:
parent
c76d0abd07
commit
4a0c20bf8c
4 changed files with 8 additions and 8 deletions
|
@ -26,7 +26,7 @@ class_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
|
|||
{
|
||||
struct class_attribute * class_attr = to_class_attr(attr);
|
||||
struct class * dc = to_class(kobj);
|
||||
ssize_t ret = 0;
|
||||
ssize_t ret = -EIO;
|
||||
|
||||
if (class_attr->show)
|
||||
ret = class_attr->show(dc, buf);
|
||||
|
@ -39,7 +39,7 @@ class_attr_store(struct kobject * kobj, struct attribute * attr,
|
|||
{
|
||||
struct class_attribute * class_attr = to_class_attr(attr);
|
||||
struct class * dc = to_class(kobj);
|
||||
ssize_t ret = 0;
|
||||
ssize_t ret = -EIO;
|
||||
|
||||
if (class_attr->store)
|
||||
ret = class_attr->store(dc, buf, count);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue