Skip to content

Commit

Permalink
ACPI: use device_type rather than comparing HID
Browse files Browse the repository at this point in the history
Check the acpi_device device_type rather than the HID.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Bjorn Helgaas authored and Len Brown committed Sep 25, 2009
1 parent caaa6ef commit ccba2a3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,15 +378,13 @@ static acpi_status acpi_device_notify_fixed(void *data)
static int acpi_device_install_notify_handler(struct acpi_device *device)
{
acpi_status status;
char *hid;

hid = acpi_device_hid(device);
if (!strcmp(hid, ACPI_BUTTON_HID_POWERF))
if (device->device_type == ACPI_BUS_TYPE_POWER_BUTTON)
status =
acpi_install_fixed_event_handler(ACPI_EVENT_POWER_BUTTON,
acpi_device_notify_fixed,
device);
else if (!strcmp(hid, ACPI_BUTTON_HID_SLEEPF))
else if (device->device_type == ACPI_BUS_TYPE_SLEEP_BUTTON)
status =
acpi_install_fixed_event_handler(ACPI_EVENT_SLEEP_BUTTON,
acpi_device_notify_fixed,
Expand All @@ -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)
{
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_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_device_notify_fixed);
else
Expand Down

0 comments on commit ccba2a3

Please sign in to comment.