summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/battery.c
diff options
context:
space:
mode:
authorPatrick Mochel <mochel@linux.intel.com>2006-05-19 16:54:39 -0400
committerLen Brown <len.brown@intel.com>2006-06-30 02:30:38 -0400
commit145def84a177c01cf3cc6cfbb67a029f39a8ac35 (patch)
tree074655fddeea51e1612b3ec5a210719197f5e147 /drivers/acpi/battery.c
parent3b74863df5d46f794052b5ee010cfc8fd66819dd (diff)
downloadop-kernel-dev-145def84a177c01cf3cc6cfbb67a029f39a8ac35.zip
op-kernel-dev-145def84a177c01cf3cc6cfbb67a029f39a8ac35.tar.gz
ACPI: battery: add struct acpi_device to struct acpi_battery.
- Use it instead of acpi_bus_get_device().. Signed-off-by: Patrick Mochel <mochel@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/battery.c')
-rw-r--r--drivers/acpi/battery.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 00b0728..ba34ca6 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -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;
@@ -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)
@@ -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:
@@ -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;
OpenPOWER on IntegriCloud