From: Len Brown <lenb@kernel.org>
To: Alexey Starikovskiy <astarikovskiy@suse.de>
Cc: Linux-acpi@vger.kernel.org
Subject: Re: [PATCH] Subject: [PATCH] ACPI: Battery: Update info for inserted battery
Date: Mon, 22 Dec 2008 19:34:35 -0500 (EST) [thread overview]
Message-ID: <alpine.LFD.2.00.0812221934250.20902@localhost.localdomain> (raw)
In-Reply-To: <20081222234454.758.6653.stgit@thinkpad>
Applied
-- Len Brown, Intel Open Source Technology Center
On Tue, 23 Dec 2008, Alexey Starikovskiy wrote:
> Newly inserted battery might differ from one just removed, so
> update of battery info fields is required.
>
> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
> Acked-by: Andy Neitzke <neitzke@ias.edu>
>
> Signed-off-by: Alexey Starikovskiy <astarikovskiy <at> suse.de>
> ---
>
> drivers/acpi/battery.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
>
> diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
> index 1423b0c..65132f9 100644
> --- a/drivers/acpi/battery.c
> +++ b/drivers/acpi/battery.c
> @@ -471,7 +471,7 @@ static void sysfs_remove_battery(struct acpi_battery *battery)
>
> static int acpi_battery_update(struct acpi_battery *battery)
> {
> - int result;
> + int result, old_present = acpi_battery_present(battery);
> result = acpi_battery_get_status(battery);
> if (result)
> return result;
> @@ -482,7 +482,8 @@ static int acpi_battery_update(struct acpi_battery *battery)
> return 0;
> }
> #endif
> - if (!battery->update_time) {
> + if (!battery->update_time ||
> + old_present != acpi_battery_present(battery)) {
> result = acpi_battery_get_info(battery);
> if (result)
> return result;
>
prev parent reply other threads:[~2008-12-23 0:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <alpine.LFD.2.00.0812221748020.20902@localhost.localdomain>
2008-12-22 23:44 ` [PATCH] Subject: [PATCH] ACPI: Battery: Update info for inserted battery Alexey Starikovskiy
2008-12-23 0:34 ` Len Brown [this message]
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=alpine.LFD.2.00.0812221934250.20902@localhost.localdomain \
--to=lenb@kernel.org \
--cc=Linux-acpi@vger.kernel.org \
--cc=astarikovskiy@suse.de \
/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