diff options
author | Len Brown <len.brown@intel.com> | 2006-07-01 17:19:34 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-07-01 17:19:34 -0400 |
commit | 5f765b8d68fe99c8a575265d81c62382893e1e8a (patch) | |
tree | ef6ec9815aadfab4b8bcb09aeeb85d8dc29f4919 /drivers/acpi/ac.c | |
parent | b197ba3c70638a3a2ae39296781912f26ac0f991 (diff) | |
parent | d07a8577f695c807977af003b6e75f996e01a15f (diff) |
Pull acpi_device_handle_cleanup into release branch
Diffstat (limited to 'drivers/acpi/ac.c')
-rw-r--r-- | drivers/acpi/ac.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index 36ca365bcea..4537ae4838c 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c @@ -65,7 +65,7 @@ static struct acpi_driver acpi_ac_driver = { }; struct acpi_ac { - acpi_handle handle; + struct acpi_device * device; unsigned long state; }; @@ -88,7 +88,7 @@ static int acpi_ac_get_state(struct acpi_ac *ac) if (!ac) return -EINVAL; - status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state); + status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL, &ac->state); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state")); ac->state = ACPI_AC_STATUS_UNKNOWN; @@ -191,9 +191,7 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data) if (!ac) return; - if (acpi_bus_get_device(ac->handle, &device)) - return; - + device = ac->device; switch (event) { case ACPI_AC_NOTIFY_STATUS: acpi_ac_get_state(ac); @@ -223,7 +221,7 @@ static int acpi_ac_add(struct acpi_device *device) return -ENOMEM; memset(ac, 0, sizeof(struct acpi_ac)); - ac->handle = device->handle; + ac->device = device; strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_AC_CLASS); acpi_driver_data(device) = ac; @@ -236,7 +234,7 @@ static int acpi_ac_add(struct acpi_device *device) if (result) goto end; - status = acpi_install_notify_handler(ac->handle, + status = acpi_install_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, acpi_ac_notify, ac); if (ACPI_FAILURE(status)) { @@ -268,7 +266,7 @@ static int acpi_ac_remove(struct acpi_device *device, int type) ac = (struct acpi_ac *)acpi_driver_data(device); - status = acpi_remove_notify_handler(ac->handle, + status = acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, acpi_ac_notify); acpi_ac_remove_fs(device); |