ACPI: battery: Update battery information upon sysfs read.
authorAlexey Starikovskiy <astarikovskiy@suse.de>
Thu, 25 Oct 2007 21:10:47 +0000 (17:10 -0400)
committerLen Brown <len.brown@intel.com>
Thu, 25 Oct 2007 21:10:47 +0000 (17:10 -0400)
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/battery.c

index a291849f6c5d5b894cc45521428ee4bf7917fca1..9da8cec80fd1e6fdab66b6e0aa804052ceeab589 100644 (file)
@@ -130,6 +130,8 @@ static int acpi_battery_technology(struct acpi_battery *battery)
        return POWER_SUPPLY_TECHNOLOGY_UNKNOWN;
 }
 
+static int acpi_battery_update(struct acpi_battery *battery);
+
 static int acpi_battery_get_property(struct power_supply *psy,
                                     enum power_supply_property psp,
                                     union power_supply_propval *val)
@@ -139,6 +141,7 @@ static int acpi_battery_get_property(struct power_supply *psy,
        if ((!acpi_battery_present(battery)) &&
             psp != POWER_SUPPLY_PROP_PRESENT)
                return -ENODEV;
+       acpi_battery_update(battery);
        switch (psp) {
        case POWER_SUPPLY_PROP_STATUS:
                if (battery->state & 0x01)