===================================================================
@@ -177,6 +177,8 @@ static int acpi_battery_is_charged(struc
return 0;
}
+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)
@@ -184,6 +186,9 @@ static int acpi_battery_get_property(str
int ret = 0;
struct acpi_battery *battery = to_acpi_battery(psy);
+ if (acpi_battery_update(battery))
+ return -ENODEV;
+
if (acpi_battery_present(battery)) {
/* run battery update only if it is present */
acpi_battery_get_state(battery);