From: Alexey Starikovskiy <aystarik@gmail.com>
To: Andy Neitzke <neitzke@ias.edu>
Cc: linux-acpi@vger.kernel.org
Subject: Re: /proc/acpi/battery/BAT0/info stale when battery changed on Thinkpad X60t
Date: Wed, 14 May 2008 21:10:41 +0400 [thread overview]
Message-ID: <482B1D11.3000600@gmail.com> (raw)
In-Reply-To: <200805141105.02277.neitzke@ias.edu>
Please check if following patch helps:
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index b1c723f..e5ca3a0 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -472,7 +472,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;
@@ -483,7 +483,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;
next prev parent reply other threads:[~2008-05-14 17:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-14 15:05 /proc/acpi/battery/BAT0/info stale when battery changed on Thinkpad X60t Andy Neitzke
2008-05-14 17:10 ` Alexey Starikovskiy [this message]
2008-05-14 23:18 ` Andy Neitzke
2008-05-15 9:26 ` [PATCH] ACPI: Battery: Update info for inserted battery Alexey Starikovskiy
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=482B1D11.3000600@gmail.com \
--to=aystarik@gmail.com \
--cc=linux-acpi@vger.kernel.org \
--cc=neitzke@ias.edu \
/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