All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org
Subject: [PATCH 08/19] ACPI: use device_type rather than comparing HID
Date: Fri, 31 Jul 2009 15:37:14 -0600	[thread overview]
Message-ID: <20090731213714.29930.80577.stgit@bob.kio> (raw)
In-Reply-To: <20090731213501.29930.39957.stgit@bob.kio>

Check the acpi_device device_type rather than the HID.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
---
 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 b386589..f563360 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -374,15 +374,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,
@@ -400,10 +398,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


  parent reply	other threads:[~2009-07-31 21:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-31 21:36 [PATCH 00/19] ACPI: cleanups for hotplug Bjorn Helgaas
2009-07-31 21:36 ` [PATCH 01/19] ACPI: simplify deferred execution path Bjorn Helgaas
2009-07-31 21:36 ` [PATCH 02/19] ACPI: remove null pointer checks in " Bjorn Helgaas
2009-07-31 21:36 ` [PATCH 03/19] ACPI: don't pass handle for fixed hardware notifications Bjorn Helgaas
2009-07-31 21:36 ` [PATCH 04/19] ACPI: add debug for device addition Bjorn Helgaas
2009-07-31 21:36 ` [PATCH 05/19] ACPI: remove unused acpi_bus_scan_fixed() argument Bjorn Helgaas
2009-07-31 21:37 ` [PATCH 06/19] ACPI: remove redundant "handle" and "parent" arguments Bjorn Helgaas
2009-07-31 21:37 ` [PATCH 07/19] ACPI: save device_type in acpi_device Bjorn Helgaas
2009-07-31 21:37 ` Bjorn Helgaas [this message]
2009-07-31 21:37 ` [PATCH 09/19] ACPI: remove acpi_device_set_context() "type" argument Bjorn Helgaas
2009-07-31 21:37 ` [PATCH 10/19] ACPI: remove redundant "type" arguments Bjorn Helgaas
2009-07-31 21:37 ` [PATCH 11/19] ACPI: remove unnecessary argument checking Bjorn Helgaas
2009-07-31 21:37 ` [PATCH 12/19] ACPI: add acpi_bus_get_parent() and remove "parent" arguments Bjorn Helgaas
2009-07-31 21:37 ` [PATCH 13/19] ACPI: convert acpi_bus_scan() to operate on an acpi_handle Bjorn Helgaas
2009-07-31 21:37 ` [PATCH 14/19] ACPI: enumerate namespace before adding functional fixed hardware devices Bjorn Helgaas
2009-07-31 21:37 ` [PATCH 15/19] ACPI: identify device tree root by null parent pointer, not ACPI_BUS_TYPE Bjorn Helgaas
2009-08-02 14:44   ` Len Brown
2009-07-31 21:37 ` [PATCH 16/19] ACPI: use acpi_walk_namespace() to enumerate devices Bjorn Helgaas
2009-07-31 21:38 ` [PATCH 17/19] ACPI: add acpi_bus_get_status_handle() Bjorn Helgaas
2009-07-31 21:38 ` [PATCH 18/19] ACPI: factor out device type and status checking Bjorn Helgaas
2009-07-31 21:38 ` [PATCH 19/19] ACPI: handle re-enumeration, when acpi_devices might already exist Bjorn Helgaas
2009-08-02 15:12 ` [PATCH 00/19] ACPI: cleanups for hotplug Len Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090731213714.29930.80577.stgit@bob.kio \
    --to=bjorn.helgaas@hp.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.