Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1391632

[PATCH v3 2/3] ACPI/device_sysfs: Change _SUN and _STA show functions error return to EIO

Path csiph.com!news.freedyn.net!aioe.org!bofh.it!news.nic.it!robomod
From Betty Dall <betty.dall@hpe.com>
Newsgroups linux.kernel
Subject [PATCH v3 2/3] ACPI/device_sysfs: Change _SUN and _STA show functions error return to EIO
Date Sat, 30 Apr 2016 18:10:02 +0200
Message-ID <rtFCW-239-15@gated-at.bofh.it> (permalink)
References <rtFCV-239-5@gated-at.bofh.it>
X-Original-To rjw@rjwysocki.net, lenb@kernel.org, linux-acpi@vger.kernel.org
X-Mailer git-send-email 1.9.1
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 35
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, Betty Dall <betty.dall@hpe.com>
X-Original-Date Sat, 30 Apr 2016 10:03:38 -0600
X-Original-Message-ID <1462032219-12590-3-git-send-email-betty.dall@hpe.com>
X-Original-References <1462032219-12590-1-git-send-email-betty.dall@hpe.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1391632

Show key headers only | View raw


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 <betty.dall@hpe.com>
---
 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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH v3 2/3] ACPI/device_sysfs: Change _SUN and _STA show functions error return to EIO Betty Dall <betty.dall@hpe.com> - 2016-04-30 18:10 +0200

csiph-web