lkml.org 
[lkml]   [2014]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH V2] ACPI/Battery: Add a _BIX quirk for NEC LZ750/LS
Date
If an object does not exist, AE_NOT_FOUND is returned by evaluate_object.

If the package is empty or has insufficient elements, something like AE_AML_OPERAND_VALUE is returned.


> -----Original Message-----
> From: Lan, Tianyu
> Sent: Wednesday, January 15, 2014 7:07 AM
> To: Matthew Garrett
> Cc: Rafael J. Wysocki; Dmitry Torokhov; lenb@kernel.org; linux-
> acpi@vger.kernel.org; linux-kernel@vger.kernel.org; fcr@adinet.com.uy;
> l@dorileo.org; Zheng, Lv; Moore, Robert
> Subject: Re: [PATCH V2] ACPI/Battery: Add a _BIX quirk for NEC LZ750/LS
>
> On 01/15/2014 10:47 PM, Matthew Garrett wrote:
> > On Wed, Jan 15, 2014 at 10:42:31PM +0800, Lan Tianyu wrote:
> >> diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index
> >> fbf1ace..e98fa83 100644
> >> --- a/drivers/acpi/battery.c
> >> +++ b/drivers/acpi/battery.c
> >> @@ -770,7 +770,7 @@ static int acpi_battery_add(struct acpi_device
> *device)
> >> device->driver_data = battery;
> >> mutex_init(&battery->lock);
> >> mutex_init(&battery->sysfs_lock);
> >> - if (acpi_has_method(battery->device->handle, "_BIX"))
> >> + if (acpi_evaluate_object(device->handle, "_BIX", NULL,
> >> + &buffer);)
> >> set_bit(ACPI_BATTERY_XINFO_PRESENT,
> >> &battery->flags);
> >
> > Doesn't acpi_evaluate_object() return 0 on success? I think:
> >
> > if (ACPI_SUCESS(acpi_evaluate_object(device->handle, "_BIX", NULL,
> > &buffer))
> >
>
> Yes, Sorry for oops.
>
> > But maybe we should check for existence first and give an FW_BUG
> > message to indicate an invalid _BIX?
>
> Yes, this is a good idea.
>
> Another point, the acpi_evaluate_object should return different error code
> for these two cases(no _BIX and wrong size.). I wonder whether we can use
> the error code to determine it belong which case?
> >
>
>
> --
> Best Regards
> Tianyu Lan
\
 
 \ /
  Last update: 2014-01-15 18:41    [W:0.051 / U:0.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site