Linux ACPI
 help / color / mirror / Atom feed
From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: linux acpi <linux-acpi@vger.kernel.org>
Cc: Alexey Starikovskiy <alexey.y.starikovskiy@linux.intel.com>
Subject: [RESEND] [PATCH 1/3] ACPI: battery: Fix CONFIG_ACPI_SYSFS_POWER=n
Date: Tue, 30 Jun 2009 15:30:52 +0100	[thread overview]
Message-ID: <4A4A219C.2020802@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>
CC: Alexey Starikovskiy <alexey.y.starikovskiy@linux.intel.com>
---
 drivers/acpi/battery.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 58b4517..908edce 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);
-- 
1.6.3.2




             reply	other threads:[~2009-06-30 14:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-30 14:30 Alan Jenkins [this message]
2009-06-30 14:35 ` [RESEND] [PATCH 1/3] ACPI: battery: Fix CONFIG_ACPI_SYSFS_POWER=n Alan Jenkins
2009-06-30 14:36   ` [RESEND] [PATCH 2/3] ACPI: battery drivers should call power_supply_changed() Alan Jenkins
2009-06-30 14:37   ` [RESEND] [PATCH 3/3] ACPI: battery: register power_supply subdevice even when battery not present Alan Jenkins
2009-09-07 16:06 ` [RESEND] [PATCH 1/3] ACPI: battery: Fix CONFIG_ACPI_SYSFS_POWER=n Maxim Levitsky
2009-09-09 17:22   ` Alan Jenkins
2009-09-09 21:21     ` Maxim Levitsky
2009-09-10 11:11       ` Alan Jenkins
2009-09-11  2:34         ` Maxim Levitsky
2009-12-10  4:49         ` Len Brown
2009-12-11 10:50           ` Alan Jenkins

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=4A4A219C.2020802@tuffmail.co.uk \
    --to=alan-jenkins@tuffmail.co.uk \
    --cc=alexey.y.starikovskiy@linux.intel.com \
    --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