From: Alexey Starikovskiy Date: Thu, 25 Oct 2007 21:10:47 +0000 (-0400) Subject: ACPI: battery: Update battery information upon sysfs read. X-Git-Tag: firefly_0821_release~24558^2~3^2~4 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b19073a0be5e317d626b3b404e0039b59383891c;p=firefly-linux-kernel-4.4.55.git ACPI: battery: Update battery information upon sysfs read. Signed-off-by: Alexey Starikovskiy Signed-off-by: Len Brown --- 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)