]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ACPI: battery: Fix CONFIG_ACPI_SYSFS_POWER=n
authorAlan Jenkins <alan-jenkins@tuffmail.co.uk>
Tue, 30 Jun 2009 14:35:05 +0000 (14:35 +0000)
committerLen Brown <len.brown@intel.com>
Sun, 4 Apr 2010 23:53:04 +0000 (19:53 -0400)
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>
drivers/acpi/battery.c

index 75f39f2c166d88b3b186a0bb2633fac77165753b..52df9947dbb2538d2caffa79410828736088a8ed 100644 (file)
@@ -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);