ACPI / SBS: Add getting state operation in the acpi_sbs_battery_get_property()
authorLan Tianyu <tianyu.lan@intel.com>
Fri, 1 Jul 2011 08:03:15 +0000 (16:03 +0800)
committerLen Brown <len.brown@intel.com>
Thu, 14 Jul 2011 04:01:26 +0000 (00:01 -0400)
https://bugzilla.kernel.org/show_bug.cgi?id=24492

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/sbs.c

index 51ae3794ec7f895f16cb2cf4545f6f146860909f..01dad1bedd177a05e6cbf26cc4b64f687f566388 100644 (file)
@@ -130,6 +130,9 @@ struct acpi_sbs {
 
 #define to_acpi_sbs(x) container_of(x, struct acpi_sbs, charger)
 
+static int acpi_sbs_remove(struct acpi_device *device, int type);
+static int acpi_battery_get_state(struct acpi_battery *battery);
+
 static inline int battery_scale(int log)
 {
        int scale = 1;
@@ -195,6 +198,8 @@ static int acpi_sbs_battery_get_property(struct power_supply *psy,
 
        if ((!battery->present) && psp != POWER_SUPPLY_PROP_PRESENT)
                return -ENODEV;
+
+       acpi_battery_get_state(battery);
        switch (psp) {
        case POWER_SUPPLY_PROP_STATUS:
                if (battery->rate_now < 0)
@@ -903,8 +908,6 @@ static void acpi_sbs_callback(void *context)
        }
 }
 
-static int acpi_sbs_remove(struct acpi_device *device, int type);
-
 static int acpi_sbs_add(struct acpi_device *device)
 {
        struct acpi_sbs *sbs;