diff options
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r-- | drivers/acpi/scan.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index c73681b7e69e..c8e867b4a842 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -378,15 +378,13 @@ static acpi_status acpi_device_notify_fixed(void *data) | |||
378 | static int acpi_device_install_notify_handler(struct acpi_device *device) | 378 | static int acpi_device_install_notify_handler(struct acpi_device *device) |
379 | { | 379 | { |
380 | acpi_status status; | 380 | acpi_status status; |
381 | char *hid; | ||
382 | 381 | ||
383 | hid = acpi_device_hid(device); | 382 | if (device->device_type == ACPI_BUS_TYPE_POWER_BUTTON) |
384 | if (!strcmp(hid, ACPI_BUTTON_HID_POWERF)) | ||
385 | status = | 383 | status = |
386 | acpi_install_fixed_event_handler(ACPI_EVENT_POWER_BUTTON, | 384 | acpi_install_fixed_event_handler(ACPI_EVENT_POWER_BUTTON, |
387 | acpi_device_notify_fixed, | 385 | acpi_device_notify_fixed, |
388 | device); | 386 | device); |
389 | else if (!strcmp(hid, ACPI_BUTTON_HID_SLEEPF)) | 387 | else if (device->device_type == ACPI_BUS_TYPE_SLEEP_BUTTON) |
390 | status = | 388 | status = |
391 | acpi_install_fixed_event_handler(ACPI_EVENT_SLEEP_BUTTON, | 389 | acpi_install_fixed_event_handler(ACPI_EVENT_SLEEP_BUTTON, |
392 | acpi_device_notify_fixed, | 390 | acpi_device_notify_fixed, |
@@ -404,10 +402,10 @@ static int acpi_device_install_notify_handler(struct acpi_device *device) | |||
404 | 402 | ||
405 | static void acpi_device_remove_notify_handler(struct acpi_device *device) | 403 | static void acpi_device_remove_notify_handler(struct acpi_device *device) |
406 | { | 404 | { |
407 | if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWERF)) | 405 | if (device->device_type == ACPI_BUS_TYPE_POWER_BUTTON) |
408 | acpi_remove_fixed_event_handler(ACPI_EVENT_POWER_BUTTON, | 406 | acpi_remove_fixed_event_handler(ACPI_EVENT_POWER_BUTTON, |
409 | acpi_device_notify_fixed); | 407 | acpi_device_notify_fixed); |
410 | else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEPF)) | 408 | else if (device->device_type == ACPI_BUS_TYPE_SLEEP_BUTTON) |
411 | acpi_remove_fixed_event_handler(ACPI_EVENT_SLEEP_BUTTON, | 409 | acpi_remove_fixed_event_handler(ACPI_EVENT_SLEEP_BUTTON, |
412 | acpi_device_notify_fixed); | 410 | acpi_device_notify_fixed); |
413 | else | 411 | else |