Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
struct acpi_ac {
acpi_handle handle;
+ struct acpi_device * device;
unsigned long state;
};
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);
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;