From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org,
Hugh Dickins <hugh.dickins@tiscali.co.uk>,
Valdis Kletnieks <Valdis.Kletnieks@vt.edu>,
Lin Ming <ming.m.lin@intel.com>,
Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH 03/10] ACPI: fix synthetic HID for \_SB_
Date: Mon, 24 Aug 2009 10:38:45 -0600 [thread overview]
Message-ID: <20090824163845.28131.71462.stgit@bob.kio> (raw)
In-Reply-To: <20090824163659.28131.96400.stgit@bob.kio>
This makes \_SB_ show up as /sys/devices/LNXSYSTM:00/LNXSYBUS:00
rather than "device:00". This has been broken for a loooong time
(at least since 2.6.13) because device->parent is an acpi_device
pointer, not a handle.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
---
drivers/acpi/scan.c | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index a253373..6de6b11 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1038,6 +1038,12 @@ static void acpi_device_set_id(struct acpi_device *device)
if (ACPI_IS_ROOT_DEVICE(device)) {
hid = ACPI_SYSTEM_HID;
break;
+ } else if (ACPI_IS_ROOT_DEVICE(device->parent)) {
+ /* \_SB_, the only root-level namespace device */
+ hid = ACPI_BUS_HID;
+ strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME);
+ strcpy(device->pnp.device_class, ACPI_BUS_CLASS);
+ break;
}
status = acpi_get_object_info(device->handle, &buffer);
@@ -1088,18 +1094,6 @@ static void acpi_device_set_id(struct acpi_device *device)
break;
}
- /*
- * \_SB
- * ----
- * Fix for the system root bus device -- the only root-level device.
- */
- if (((acpi_handle)device->parent == ACPI_ROOT_OBJECT) &&
- (device->device_type == ACPI_BUS_TYPE_DEVICE)) {
- hid = ACPI_BUS_HID;
- strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME);
- strcpy(device->pnp.device_class, ACPI_BUS_CLASS);
- }
-
if (hid) {
strcpy(device->pnp.hardware_id, hid);
device->flags.hardware_id = 1;
next prev parent reply other threads:[~2009-08-24 16:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-24 16:38 [PATCH 00/10] make every acpi_device have a HID Bjorn Helgaas
2009-08-24 16:38 ` [PATCH 01/10] ACPI: fix leak in debug code Bjorn Helgaas
2009-08-24 16:38 ` [PATCH 02/10] ACPI: add ACPI_IS_ROOT_DEVICE() Bjorn Helgaas
2009-08-24 16:38 ` Bjorn Helgaas [this message]
2009-08-24 16:38 ` [PATCH 04/10] ACPI: use acpi_device_hid() when possible Bjorn Helgaas
2009-08-24 16:38 ` [PATCH 05/10] ACPI: make sure every acpi_device has an ID Bjorn Helgaas
2009-08-24 16:39 ` [PATCH 06/10] ACPI: maintain a single list of _HID and _CID IDs Bjorn Helgaas
2009-08-24 16:39 ` [PATCH 07/10] ACPI: remove acpi_device.flags.compatible_ids Bjorn Helgaas
2009-08-24 16:39 ` [PATCH 08/10] ACPI: remove acpi_device.flags.hardware_id Bjorn Helgaas
2009-08-24 16:39 ` [PATCH 09/10] ACPI: remove acpi_device_uid() and related stuff Bjorn Helgaas
2009-08-24 16:39 ` [PATCH 10/10] ACPI: simplify building device HID/CID list Bjorn Helgaas
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=20090824163845.28131.71462.stgit@bob.kio \
--to=bjorn.helgaas@hp.com \
--cc=Valdis.Kletnieks@vt.edu \
--cc=bzolnier@gmail.com \
--cc=hugh.dickins@tiscali.co.uk \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=ming.m.lin@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).