linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lan Tianyu <tianyu.lan@intel.com>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	lenb@kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, fcr@adinet.com.uy, l@dorileo.org,
	"Zheng, Lv" <lv.zheng@intel.com>,
	robert.moore@intel.com
Subject: Re: [PATCH V2] ACPI/Battery: Add a _BIX quirk for NEC LZ750/LS
Date: Wed, 15 Jan 2014 23:06:39 +0800	[thread overview]
Message-ID: <52D6A3FF.8070100@intel.com> (raw)
In-Reply-To: <20140115144720.GA23218@srcf.ucam.org>

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

  reply	other threads:[~2014-01-15 15:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-06 14:50 [PATCH V2] ACPI/Battery: Add a _BIX quirk for NEC LZ750/LS Lan Tianyu
2014-01-06 17:59 ` Dmitry Torokhov
2014-01-06 22:25   ` Rafael J. Wysocki
2014-01-14 16:06     ` Matthew Garrett
2014-01-14 21:37       ` Rafael J. Wysocki
2014-01-14 21:24         ` Matthew Garrett
2014-01-14 22:17           ` Rafael J. Wysocki
2014-01-15 14:42             ` Lan Tianyu
2014-01-15 14:47               ` Matthew Garrett
2014-01-15 15:06                 ` Lan Tianyu [this message]
2014-01-15 16:48                   ` Moore, Robert
2014-01-15  6:17         ` Robert Hancock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52D6A3FF.8070100@intel.com \
    --to=tianyu.lan@intel.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=fcr@adinet.com.uy \
    --cc=l@dorileo.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lv.zheng@intel.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=rjw@rjwysocki.net \
    --cc=robert.moore@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).