Revert "driver core: bus: Return -EIO instead of 0 when show/store invalid bus attribute"

This reverts commit 8c57a097de.
This commit is contained in:
Ksawlii 2024-11-24 00:22:58 +01:00
parent 72a3d14a18
commit 4ff0839fae

View file

@ -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);