Skip to content

Commit

Permalink
ACPI / SBS: Add getting state operation in the acpi_sbs_battery_get_p…
Browse files Browse the repository at this point in the history
…roperty()

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>
  • Loading branch information
Lan Tianyu authored and Len Brown committed Jul 14, 2011
1 parent b4a03b9 commit 1dd5c71
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/acpi/sbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1dd5c71

Please sign in to comment.