From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753479AbcD0Qec (ORCPT ); Wed, 27 Apr 2016 12:34:32 -0400 Received: from mail-bl2on0123.outbound.protection.outlook.com ([65.55.169.123]:54432 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753330AbcD0Qea convert rfc822-to-8bit (ORCPT ); Wed, 27 Apr 2016 12:34:30 -0400 From: "Dall, Betty" To: "Rafael J. Wysocki" CC: "lenb@kernel.org" , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] ACPI/device_sysfs: Add sysfs support for _HRV hardware revision Thread-Topic: [PATCH] ACPI/device_sysfs: Add sysfs support for _HRV hardware revision Thread-Index: AQHRoKCcgScEqgDbwUOsm6w7O7yHbA== Date: Wed, 27 Apr 2016 16:19:45 +0000 Message-ID: References: <1460558894-11971-1-git-send-email-betty.dall@hpe.com> <2388310.jGjaKS2NDe@vostro.rjw.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: rjwysocki.net; dkim=none (message not signed) header.d=none;rjwysocki.net; dmarc=none action=none header.from=hpe.com; x-originating-ip: [15.65.252.14] x-ms-office365-filtering-correlation-id: aed410fa-a035-4d31-3794-08d36eb7bf50 x-microsoft-exchange-diagnostics: 1;AT5PR84MB0081;5:PJVhjOHPdQII4ynoFzHpqYaSHYdVgPWF1kGEZ8PrHW3oEXNt+5vWVnjbpIvzdNOtuVDa0BavotyWB3qrZsKYpHxT7reitedJEBzqQqHzfS2lnctGpH5E/WV4QKfM0Fz75wTLSQ9BFbvlGEHPrKlNZg==;24:jvLdBDJ0p8YiuGlMZD98rz59LiJwBxUqvvIH8UENY3H5ZaIzyjV7Hihvn29FPZcWzurRZVWKJ1hmI0RYVTdO7q7OpIPajBeuV7iBbc+eUdk=;7:rOgT9d4ArSWWHgwTuKOwoPSVEdXpX0YAjX9GJIAxtD/gbmEAok1ZB89rAPeZwpStn8xM+kbxYjWhHeYXXz+eS/Lq0SvcitDM2CC/+yGbmuFrb6znC+OySj1BTMImm/2pMHXjyWh0mEsCpKabaShEZXMHcwtl2h9vGUs/CfKT+MFG2Fk7xxlNXTftCfL5rzMY x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AT5PR84MB0081; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(9101521072)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:AT5PR84MB0081;BCL:0;PCL:0;RULEID:;SRVR:AT5PR84MB0081; x-forefront-prvs: 0925081676 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(377454003)(24454002)(3846002)(92566002)(122556002)(77096005)(54356999)(1096002)(2900100001)(76176999)(5004730100002)(2906002)(102836003)(586003)(9686002)(5008740100001)(11100500001)(1220700001)(81166005)(6116002)(33656002)(189998001)(110136002)(87936001)(106116001)(19580395003)(99286002)(19580405001)(66066001)(5002640100001)(10400500002)(5003600100002)(50986999)(4326007);DIR:OUT;SFP:1102;SCL:1;SRVR:AT5PR84MB0081;H:AT5PR84MB0083.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Apr 2016 16:19:45.6210 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: AT5PR84MB0081 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> --- >> 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