Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31993
b: refs/heads/master
c: 145def8
h: refs/heads/master
i:
  31991: da2b90a
v: v3
  • Loading branch information
Patrick Mochel authored and Len Brown committed Jun 30, 2006
1 parent af5333f commit 5c4fc19
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 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: 3b74863df5d46f794052b5ee010cfc8fd66819dd
refs/heads/master: 145def84a177c01cf3cc6cfbb67a029f39a8ac35
9 changes: 4 additions & 5 deletions trunk/drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ struct acpi_battery_trips {

struct acpi_battery {
acpi_handle handle;
struct acpi_device * device;
struct acpi_battery_flags flags;
struct acpi_battery_trips trips;
unsigned long alarm;
Expand Down Expand Up @@ -278,9 +279,7 @@ static int acpi_battery_check(struct acpi_battery *battery)
if (!battery)
return -EINVAL;

result = acpi_bus_get_device(battery->handle, &device);
if (result)
return result;
device = battery->device;

result = acpi_bus_get_status(device);
if (result)
Expand Down Expand Up @@ -662,8 +661,7 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
if (!battery)
return;

if (acpi_bus_get_device(handle, &device))
return;
device = battery->device;

switch (event) {
case ACPI_BATTERY_NOTIFY_STATUS:
Expand Down Expand Up @@ -696,6 +694,7 @@ static int acpi_battery_add(struct acpi_device *device)
memset(battery, 0, sizeof(struct acpi_battery));

battery->handle = device->handle;
battery->device = device;
strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME);
strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS);
acpi_driver_data(device) = battery;
Expand Down

0 comments on commit 5c4fc19

Please sign in to comment.