From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: linux acpi <linux-acpi@vger.kernel.org>
Cc: Alexey Starikovskiy <astarikovskiy@suse.de>
Subject: [PATCH 1/3] ACPI: battery: Fix CONFIG_ACPI_SYSFS_POWER=n
Date: Tue, 12 May 2009 15:50:12 +0100 [thread overview]
Message-ID: <4A098CA4.40708@tuffmail.co.uk> (raw)
Disabling CONFIG_ACPI_SYSFS_POWER changes the behaviour of
acpi_battery_update(). It will call acpi_battery_get_info()
even if the battery is not present. I haven't noticed this
causing any problem, but it does look like a bad idea.
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index b0de631..2ccc87e 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -501,13 +501,13 @@ static int acpi_battery_update(struct acpi_battery *battery)
result = acpi_battery_get_status(battery);
if (result)
return result;
-#ifdef CONFIG_ACPI_SYSFS_POWER
if (!acpi_battery_present(battery)) {
+#ifdef CONFIG_ACPI_SYSFS_POWER
sysfs_remove_battery(battery);
+#endif
battery->update_time = 0;
return 0;
}
-#endif
if (!battery->update_time ||
old_present != acpi_battery_present(battery)) {
result = acpi_battery_get_info(battery);
reply other threads:[~2009-05-12 14:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4A098CA4.40708@tuffmail.co.uk \
--to=alan-jenkins@tuffmail.co.uk \
--cc=astarikovskiy@suse.de \
--cc=linux-acpi@vger.kernel.org \
/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