From: "Rafael J. Wysocki" Subject: Re: [PATCH] ACPI / Battery: Return -ENODATA for unknown values in get_property() Date: Mon, 25 Oct 2010 22:36:31 +0200 Message-ID: <201010252236.31530.rjw@sisk.pl> References: <20101016141321.GA11054@sucs.org> <201010172032.43206.rjw@sisk.pl> <20101025131728.GC2162@ucw.cz> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: Received: from ogre.sisk.pl ([217.79.144.158]:51644 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756967Ab0JYUha (ORCPT ); Mon, 25 Oct 2010 16:37:30 -0400 In-Reply-To: <20101025131728.GC2162@ucw.cz> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Pavel Machek Cc: Sitsofe Wheeler , Henrique de Moraes Holschuh , Matthew Garrett , Len Brown , Zhang Rui , David Zeuthen , Richard Hughes , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org On Monday, October 25, 2010, Pavel Machek wrote: > Hi! > > > That's why I suggested to use -ENODATA. :-) > > > > Still, if user space has problems with failing reads from the sysfs attributes, > > it may be better to simply put -1 in there. Patch is appended, please test. > > I'd say that reporting -1 for unknown is ugly. You can have -1A > current easily (charging at 1A), and I've seen machines reporting <0 > current -- when charging. Logical and well-defined. I posted a patch fixing that in a different way (makng the battery driver return -ENODEV instead of -ENODATA) in the meantime, which has been confirmed to work. Thanks, Rafael