Commit ccba2a36 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Len Brown

ACPI: use device_type rather than comparing HID

Check the acpi_device device_type rather than the HID.
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent caaa6efb
...@@ -378,15 +378,13 @@ static acpi_status acpi_device_notify_fixed(void *data) ...@@ -378,15 +378,13 @@ static acpi_status acpi_device_notify_fixed(void *data)
static int acpi_device_install_notify_handler(struct acpi_device *device) static int acpi_device_install_notify_handler(struct acpi_device *device)
{ {
acpi_status status; acpi_status status;
char *hid;
hid = acpi_device_hid(device); if (device->device_type == ACPI_BUS_TYPE_POWER_BUTTON)
if (!strcmp(hid, ACPI_BUTTON_HID_POWERF))
status = status =
acpi_install_fixed_event_handler(ACPI_EVENT_POWER_BUTTON, acpi_install_fixed_event_handler(ACPI_EVENT_POWER_BUTTON,
acpi_device_notify_fixed, acpi_device_notify_fixed,
device); device);
else if (!strcmp(hid, ACPI_BUTTON_HID_SLEEPF)) else if (device->device_type == ACPI_BUS_TYPE_SLEEP_BUTTON)
status = status =
acpi_install_fixed_event_handler(ACPI_EVENT_SLEEP_BUTTON, acpi_install_fixed_event_handler(ACPI_EVENT_SLEEP_BUTTON,
acpi_device_notify_fixed, acpi_device_notify_fixed,
...@@ -404,10 +402,10 @@ static int acpi_device_install_notify_handler(struct acpi_device *device) ...@@ -404,10 +402,10 @@ static int acpi_device_install_notify_handler(struct acpi_device *device)
static void acpi_device_remove_notify_handler(struct acpi_device *device) static void acpi_device_remove_notify_handler(struct acpi_device *device)
{ {
if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWERF)) if (device->device_type == ACPI_BUS_TYPE_POWER_BUTTON)
acpi_remove_fixed_event_handler(ACPI_EVENT_POWER_BUTTON, acpi_remove_fixed_event_handler(ACPI_EVENT_POWER_BUTTON,
acpi_device_notify_fixed); acpi_device_notify_fixed);
else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEPF)) else if (device->device_type == ACPI_BUS_TYPE_SLEEP_BUTTON)
acpi_remove_fixed_event_handler(ACPI_EVENT_SLEEP_BUTTON, acpi_remove_fixed_event_handler(ACPI_EVENT_SLEEP_BUTTON,
acpi_device_notify_fixed); acpi_device_notify_fixed);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment