Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73569
b: refs/heads/master
c: 9104476
h: refs/heads/master
i:
  73567: 079f9ec
v: v3
  • Loading branch information
Alexey Starikovskiy authored and Linus Torvalds committed Nov 13, 2007
1 parent d3f506e commit 00d0364
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b832a4b93932103d73c0c3f35ef1153e288327b
refs/heads/master: 9104476e4efbef8a8e32d48ced583603ff32a2db
10 changes: 6 additions & 4 deletions trunk/drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,19 @@ 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_state(struct acpi_battery *battery);

static int acpi_battery_get_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{
struct acpi_battery *battery = to_acpi_battery(psy);

if ((!acpi_battery_present(battery)) &&
psp != POWER_SUPPLY_PROP_PRESENT)
if (acpi_battery_present(battery)) {
/* run battery update only if it is present */
acpi_battery_get_state(battery);
} else if (psp != POWER_SUPPLY_PROP_PRESENT)
return -ENODEV;
acpi_battery_update(battery);
switch (psp) {
case POWER_SUPPLY_PROP_STATUS:
if (battery->state & 0x01)
Expand Down Expand Up @@ -457,6 +458,7 @@ static void sysfs_remove_battery(struct acpi_battery *battery)
return;
device_remove_file(battery->bat.dev, &alarm_attr);
power_supply_unregister(&battery->bat);
battery->bat.dev = NULL;
}

static int acpi_battery_update(struct acpi_battery *battery)
Expand Down

0 comments on commit 00d0364

Please sign in to comment.