Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1388052 > unrolled thread
| Started by | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| First post | 2016-04-26 22:40 +0200 |
| Last post | 2016-04-27 23:20 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] ACPI/device_sysfs: Add sysfs support for _HRV hardware revision "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-04-26 22:40 +0200
Re: [PATCH] ACPI/device_sysfs: Add sysfs support for _HRV hardware revision "Dall, Betty" <betty.dall@hpe.com> - 2016-04-27 18:40 +0200
Re: [PATCH] ACPI/device_sysfs: Add sysfs support for _HRV hardware revision "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-04-27 23:20 +0200
| From | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| Date | 2016-04-26 22:40 +0200 |
| Subject | Re: [PATCH] ACPI/device_sysfs: Add sysfs support for _HRV hardware revision |
| Message-ID | <rshW4-5I2-57@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | "Dall, Betty" <betty.dall@hpe.com> |
|---|---|
| Date | 2016-04-27 18:40 +0200 |
| Subject | Re: [PATCH] ACPI/device_sysfs: Add sysfs support for _HRV hardware revision |
| Message-ID | <rsAFj-4bo-5@gated-at.bofh.it> |
| In reply to | #1388052 |
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
[toc] | [prev] | [next] | [standalone]
| From | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| Date | 2016-04-27 23:20 +0200 |
| Message-ID | <rsF2h-8fU-7@gated-at.bofh.it> |
| In reply to | #1389341 |
On Wednesday, April 27, 2016 04:19:45 PM Dall, Betty wrote:
> 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.
Which isn't the best choice.
> 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.
But doesn't it pass the return value up the call chain?
> Do you still want me to change it to -EIO?
I may, depending on the answer to the question above.
Thanks,
Rafael
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web