Skip to content

Commit

Permalink
ACPI / device_sysfs: Change _SUN and _STA show functions error return…
Browse files Browse the repository at this point in the history
… 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: Betty Dall <betty.dall@hpe.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Betty Dall authored and Rafael J. Wysocki committed May 4, 2016
1 parent 6283f97 commit 6c02440
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/acpi/device_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
if (ACPI_FAILURE(status))
return -ENODEV;
return -EIO;

return sprintf(buf, "%llu\n", sun);
}
Expand Down Expand Up @@ -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);
if (ACPI_FAILURE(status))
return -ENODEV;
return -EIO;

return sprintf(buf, "%llu\n", sta);
}
Expand Down

0 comments on commit 6c02440

Please sign in to comment.