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;
        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)) {
 
        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);