summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/battery.c
diff options
context:
space:
mode:
authorAlexey Starikovskiy <astarikovskiy@suse.de>2007-10-25 23:10:47 +0200
committerLen Brown <len.brown@intel.com>2007-10-25 23:10:47 +0200
commitb19073a0be5e317d626b3b404e0039b59383891c (patch)
tree4c9690e1cb8635805f75e18b7d0678113b3e12b1 /drivers/acpi/battery.c
parentACPI: EC: fix use-after-free (diff)
downloadlinux-b19073a0be5e317d626b3b404e0039b59383891c.tar.xz
linux-b19073a0be5e317d626b3b404e0039b59383891c.zip
ACPI: battery: Update battery information upon sysfs read.
Signed-off-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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index a291849f6c5d..9da8cec80fd1 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -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)