diff options
author | Alexey Starikovskiy <astarikovskiy@suse.de> | 2007-10-25 17:10:47 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-10-25 17:10:47 -0400 |
commit | b19073a0be5e317d626b3b404e0039b59383891c (patch) | |
tree | 4c9690e1cb8635805f75e18b7d0678113b3e12b1 | |
parent | 1544fdbc857cbe8afca16a521d3254346befeb06 (diff) |
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>
-rw-r--r-- | drivers/acpi/battery.c | 3 |
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) | |||
130 | return POWER_SUPPLY_TECHNOLOGY_UNKNOWN; | 130 | return POWER_SUPPLY_TECHNOLOGY_UNKNOWN; |
131 | } | 131 | } |
132 | 132 | ||
133 | static int acpi_battery_update(struct acpi_battery *battery); | ||
134 | |||
133 | static int acpi_battery_get_property(struct power_supply *psy, | 135 | static int acpi_battery_get_property(struct power_supply *psy, |
134 | enum power_supply_property psp, | 136 | enum power_supply_property psp, |
135 | union power_supply_propval *val) | 137 | union power_supply_propval *val) |
@@ -139,6 +141,7 @@ static int acpi_battery_get_property(struct power_supply *psy, | |||
139 | if ((!acpi_battery_present(battery)) && | 141 | if ((!acpi_battery_present(battery)) && |
140 | psp != POWER_SUPPLY_PROP_PRESENT) | 142 | psp != POWER_SUPPLY_PROP_PRESENT) |
141 | return -ENODEV; | 143 | return -ENODEV; |
144 | acpi_battery_update(battery); | ||
142 | switch (psp) { | 145 | switch (psp) { |
143 | case POWER_SUPPLY_PROP_STATUS: | 146 | case POWER_SUPPLY_PROP_STATUS: |
144 | if (battery->state & 0x01) | 147 | if (battery->state & 0x01) |