aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/battery.c
diff options
context:
space:
mode:
authorAlan Jenkins <alan-jenkins@tuffmail.co.uk>2009-06-30 10:35:05 -0400
committerLen Brown <len.brown@intel.com>2010-04-04 19:53:04 -0400
commite363a755e8033e18f733fc0d1687039df8efade0 (patch)
treee0dac8e41730defa6eb86e256d5ff8f3940253fd /drivers/acpi/battery.c
parent2eaa9cfdf33b8d7fb7aff27792192e0019ae8fc6 (diff)
ACPI: battery: Fix CONFIG_ACPI_SYSFS_POWER=n
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> Acked-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/battery.c')
-rw-r--r--drivers/acpi/battery.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 75f39f2c166d..52df9947dbb2 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -567,13 +567,13 @@ static int acpi_battery_update(struct acpi_battery *battery)
567 result = acpi_battery_get_status(battery); 567 result = acpi_battery_get_status(battery);
568 if (result) 568 if (result)
569 return result; 569 return result;
570#ifdef CONFIG_ACPI_SYSFS_POWER
571 if (!acpi_battery_present(battery)) { 570 if (!acpi_battery_present(battery)) {
571#ifdef CONFIG_ACPI_SYSFS_POWER
572 sysfs_remove_battery(battery); 572 sysfs_remove_battery(battery);
573#endif
573 battery->update_time = 0; 574 battery->update_time = 0;
574 return 0; 575 return 0;
575 } 576 }
576#endif
577 if (!battery->update_time || 577 if (!battery->update_time ||
578 old_present != acpi_battery_present(battery)) { 578 old_present != acpi_battery_present(battery)) {
579 result = acpi_battery_get_info(battery); 579 result = acpi_battery_get_info(battery);