Skip to content

Commit

Permalink
ACPI: battery: Fix CONFIG_ACPI_SYSFS_POWER=n
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Jenkins authored and Len Brown committed Apr 4, 2010
1 parent 2eaa9cf commit e363a75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e363a75

Please sign in to comment.