提交 6c024409 编写于 作者: B Betty Dall 提交者: Rafael J. Wysocki

ACPI / device_sysfs: Change _SUN and _STA show functions error return to EIO

The error return from a sysfs show function is passed up through
the call chain and visible as the return from the read system call.
The show functions for the _STA and _SUN object currently return
-ENODEV. This patch changes the return to -EIO. ENODEV makes less
sense since the "device' exists or there wouldn't be a sysfs file.
Signed-off-by: NBetty Dall <betty.dall@hpe.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 6283f97d
...@@ -467,7 +467,7 @@ acpi_device_sun_show(struct device *dev, struct device_attribute *attr, ...@@ -467,7 +467,7 @@ acpi_device_sun_show(struct device *dev, struct device_attribute *attr,
status = acpi_evaluate_integer(acpi_dev->handle, "_SUN", NULL, &sun); status = acpi_evaluate_integer(acpi_dev->handle, "_SUN", NULL, &sun);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
return -ENODEV; return -EIO;
return sprintf(buf, "%llu\n", sun); return sprintf(buf, "%llu\n", sun);
} }
...@@ -496,7 +496,7 @@ static ssize_t status_show(struct device *dev, struct device_attribute *attr, ...@@ -496,7 +496,7 @@ static ssize_t status_show(struct device *dev, struct device_attribute *attr,
status = acpi_evaluate_integer(acpi_dev->handle, "_STA", NULL, &sta); status = acpi_evaluate_integer(acpi_dev->handle, "_STA", NULL, &sta);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
return -ENODEV; return -EIO;
return sprintf(buf, "%llu\n", sta); return sprintf(buf, "%llu\n", sta);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册