From: "Dall, Betty" <betty.dall@hpe.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: "lenb@kernel.org" <lenb@kernel.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ACPI/device_sysfs: Add sysfs support for _HRV hardware revision
Date: Wed, 27 Apr 2016 16:19:45 +0000 [thread overview]
Message-ID: <AT5PR84MB008340CB53E60CE8C511BEDE9D640@AT5PR84MB0083.NAMPRD84.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <2388310.jGjaKS2NDe@vostro.rjw.lan>
On 04/26/2016 02:39 PM, Rafael J. Wysocki wrote:
> On Wednesday, April 13, 2016 08:48:14 AM Betty Dall wrote:
>> The ACPI _HRV object on the device is used to supply Linux with
>> the device's hardware revision. This is an optional object. Add
>> sysfs support for the _HRV object if it exists on the device.
>>
>> Signed-off-by: Betty Dall <betty.dall@hpe.com>
>> ---
>> drivers/acpi/device_sysfs.c | 24 ++++++++++++++++++++++++
>> 1 file changed, 24 insertions(+)
>>
>> diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c
>> index b9afb47..bf12dbe 100644
>> --- a/drivers/acpi/device_sysfs.c
>> +++ b/drivers/acpi/device_sysfs.c
>> @@ -473,6 +473,21 @@ acpi_device_sun_show(struct device *dev, struct device_attribute *attr,
>> }
>> static DEVICE_ATTR(sun, 0444, acpi_device_sun_show, NULL);
>>
>> +static ssize_t
>> +acpi_device_hrv_show(struct device *dev, struct device_attribute *attr,
>> + char *buf) {
>> + struct acpi_device *acpi_dev = to_acpi_device(dev);
>> + acpi_status status;
>> + unsigned long long hrv;
>> +
>> + status = acpi_evaluate_integer(acpi_dev->handle, "_HRV", NULL, &hrv);
>> + if (ACPI_FAILURE(status))
>> + return -ENODEV;
>
> Actually, this should be -EIO I think.
>
> Thanks,
> Rafael
Hi Rafael,
I picked -ENODEV because the _SUN and _STA show functions use -ENODEV
for a return value when the acpi_evaluate_integer() fails.
I checked in the sysfs code what the return value is used for and any
negative value is treated the same, that is, the sysfs code is not
looking specifically for -EIO.
Do you still want me to change it to -EIO?
-Betty
next prev parent reply other threads:[~2016-04-27 16:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-13 14:48 Betty Dall
2016-04-26 20:35 ` Rafael J. Wysocki
2016-04-27 16:15 ` Dall, Betty
2016-04-27 21:19 ` Rafael J. Wysocki
2016-04-26 20:41 ` Rafael J. Wysocki
2016-04-27 16:19 ` Dall, Betty [this message]
2016-04-27 21:21 ` Rafael J. Wysocki
2016-04-29 13:55 ` Dall, Betty
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=AT5PR84MB008340CB53E60CE8C511BEDE9D640@AT5PR84MB0083.NAMPRD84.PROD.OUTLOOK.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®