From patchwork Mon Sep 21 19:35:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 49108 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8LJZBt9009898 for ; Mon, 21 Sep 2009 19:35:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753348AbZIUTfB (ORCPT ); Mon, 21 Sep 2009 15:35:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753364AbZIUTfB (ORCPT ); Mon, 21 Sep 2009 15:35:01 -0400 Received: from g4t0016.houston.hp.com ([15.201.24.19]:19215 "EHLO g4t0016.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753348AbZIUTfA (ORCPT ); Mon, 21 Sep 2009 15:35:00 -0400 Received: from g4t0018.houston.hp.com (g4t0018.houston.hp.com [16.234.32.27]) by g4t0016.houston.hp.com (Postfix) with ESMTP id BAFBB14038; Mon, 21 Sep 2009 19:35:04 +0000 (UTC) Received: from ldl (linux.corp.hp.com [15.11.146.101]) by g4t0018.houston.hp.com (Postfix) with ESMTP id A6242100ED; Mon, 21 Sep 2009 19:35:04 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id 8C76CCF000E; Mon, 21 Sep 2009 13:35:04 -0600 (MDT) Received: from ldl ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9fa5xSSRaRut; Mon, 21 Sep 2009 13:35:04 -0600 (MDT) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl (Postfix) with ESMTP id 759A2CF000D; Mon, 21 Sep 2009 13:35:04 -0600 (MDT) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id 6DDF72615C; Mon, 21 Sep 2009 13:35:04 -0600 (MDT) Subject: [PATCH v3 1/8] ACPI: fix synthetic HID for \_SB_ To: Len Brown From: Bjorn Helgaas Cc: linux-acpi@vger.kernel.org, Hugh Dickins , Valdis Kletnieks , Lin Ming , Bartlomiej Zolnierkiewicz Date: Mon, 21 Sep 2009 13:35:04 -0600 Message-ID: <20090921193504.21656.68847.stgit@bob.kio> In-Reply-To: <20090921193417.21656.32718.stgit@bob.kio> References: <20090921193417.21656.32718.stgit@bob.kio> User-Agent: StGit/0.14.3.386.gb02d MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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 --- drivers/acpi/scan.c | 18 ++++++------------ 1 files changed, 6 insertions(+), 12 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 2c4cac5..e9227ea 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1100,6 +1100,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, &info); @@ -1149,18 +1155,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) { device->pnp.hardware_id = ACPI_ALLOCATE_ZEROED(strlen (hid) + 1); if (device->pnp.hardware_id) {