From 4ff0839fae9a0b1175170830b3b930cc0b192d65 Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Sun, 24 Nov 2024 00:22:58 +0100 Subject: [PATCH] Revert "driver core: bus: Return -EIO instead of 0 when show/store invalid bus attribute" This reverts commit 8c57a097de036502310812a24fba9312450bb67c. --- drivers/base/bus.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 47ab755ae..df85e928b 100755 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -104,8 +104,7 @@ static ssize_t bus_attr_show(struct kobject *kobj, struct attribute *attr, { struct bus_attribute *bus_attr = to_bus_attr(attr); struct subsys_private *subsys_priv = to_subsys_private(kobj); - /* return -EIO for reading a bus attribute without show() */ - ssize_t ret = -EIO; + ssize_t ret = 0; if (bus_attr->show) ret = bus_attr->show(subsys_priv->bus, buf); @@ -117,8 +116,7 @@ static ssize_t bus_attr_store(struct kobject *kobj, struct attribute *attr, { struct bus_attribute *bus_attr = to_bus_attr(attr); struct subsys_private *subsys_priv = to_subsys_private(kobj); - /* return -EIO for writing a bus attribute without store() */ - ssize_t ret = -EIO; + ssize_t ret = 0; if (bus_attr->store) ret = bus_attr->store(subsys_priv->bus, buf, count);