From: Betty Dall <betty.dall@hpe.com>
To: rjw@rjwysocki.net, lenb@kernel.org, linux-acpi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Betty Dall <betty.dall@hpe.com>
Subject: [PATCH v3 2/3] ACPI/device_sysfs: Change _SUN and _STA show functions error return to EIO
Date: Sat, 30 Apr 2016 10:03:38 -0600 [thread overview]
Message-ID: <1462032219-12590-3-git-send-email-betty.dall@hpe.com> (raw)
In-Reply-To: <1462032219-12590-1-git-send-email-betty.dall@hpe.com>
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>
---
drivers/acpi/device_sysfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c
index 49cc0cb..e556a3e 100644
--- a/drivers/acpi/device_sysfs.c
+++ b/drivers/acpi/device_sysfs.c
@@ -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);
}
@@ -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);
}
--
1.9.1
next prev parent reply other threads:[~2016-04-30 16:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-30 16:03 [PATCH v3 0/3] ACPI/device_sysfs: Add sysfs support for _HRV hardware revision Betty Dall
2016-04-30 16:03 ` [PATCH v3 1/3] " Betty Dall
2016-04-30 16:03 ` Betty Dall [this message]
2016-04-30 16:03 ` [PATCH v3 3/3] ACPI/device_sysfs: Clean up checkpatch errors Betty Dall
2016-05-05 23:42 ` [PATCH v3 0/3] ACPI/device_sysfs: Add sysfs support for _HRV hardware revision Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1462032219-12590-3-git-send-email-betty.dall@hpe.com \
--to=betty.dall@hpe.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@rjwysocki.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®