diff options
author | Alan Jenkins <alan-jenkins@tuffmail.co.uk> | 2009-06-30 16:35:05 +0200 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-04-05 01:53:04 +0200 |
commit | e363a755e8033e18f733fc0d1687039df8efade0 (patch) | |
tree | e0dac8e41730defa6eb86e256d5ff8f3940253fd /drivers/acpi | |
parent | Linux 2.6.34-rc3 (diff) | |
download | linux-e363a755e8033e18f733fc0d1687039df8efade0.tar.xz linux-e363a755e8033e18f733fc0d1687039df8efade0.zip |
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')
-rw-r--r-- | 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 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) 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); |