Re: [PATCH] ACPI/device_sysfs: Add sysfs support for _HRV hardware revision

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
> ---
>  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

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux