From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752657AbcD2TXK (ORCPT ); Fri, 29 Apr 2016 15:23:10 -0400 Received: from g4t3427.houston.hp.com ([15.201.208.55]:52652 "EHLO g4t3427.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752412AbcD2TXH (ORCPT ); Fri, 29 Apr 2016 15:23:07 -0400 From: Betty Dall To: rjw@rjwysocki.net, lenb@kernel.org, linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Betty Dall Subject: [PATCH v2 2/3] ACPI/device_sysfs: Change _SUN and _STA show functions error return to EIO Date: Fri, 29 Apr 2016 13:21:20 -0600 Message-Id: <1461957681-6163-3-git-send-email-betty.dall@hpe.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461957681-6163-1-git-send-email-betty.dall@hpe.com> References: <1461957681-6163-1-git-send-email-betty.dall@hpe.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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