From patchwork Mon Sep 21 19:29:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 49094 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 n8LJSloV009091 for ; Mon, 21 Sep 2009 19:29:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753124AbZIUT3H (ORCPT ); Mon, 21 Sep 2009 15:29:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753359AbZIUT3H (ORCPT ); Mon, 21 Sep 2009 15:29:07 -0400 Received: from g4t0014.houston.hp.com ([15.201.24.17]:2445 "EHLO g4t0014.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753348AbZIUT3G (ORCPT ); Mon, 21 Sep 2009 15:29:06 -0400 Received: from g5t0029.atlanta.hp.com (g5t0029.atlanta.hp.com [16.228.8.141]) by g4t0014.houston.hp.com (Postfix) with ESMTP id A8C0824345; Mon, 21 Sep 2009 19:29:10 +0000 (UTC) Received: from ldl (linux.corp.hp.com [15.11.146.101]) by g5t0029.atlanta.hp.com (Postfix) with ESMTP id 6FB4B103A9; Mon, 21 Sep 2009 19:29:10 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id 66B44CF000E; Mon, 21 Sep 2009 13:29:10 -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 hQT+IPxEKyHZ; Mon, 21 Sep 2009 13:29:10 -0600 (MDT) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl (Postfix) with ESMTP id 527F5CF000D; Mon, 21 Sep 2009 13:29:10 -0600 (MDT) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id 2319C2615C; Mon, 21 Sep 2009 13:29:10 -0600 (MDT) Subject: [PATCH v3 05/17] ACPI: save device_type in acpi_device To: Len Brown From: Bjorn Helgaas Cc: linux-acpi@vger.kernel.org Date: Mon, 21 Sep 2009 13:29:10 -0600 Message-ID: <20090921192910.21322.13930.stgit@bob.kio> In-Reply-To: <20090921192656.21322.23072.stgit@bob.kio> References: <20090921192656.21322.23072.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 Most uses of the ACPI bus device_type (ACPI_BUS_TYPE_DEVICE, ACPI_BUS_TYPE_POWER, etc) are during device initialization, but we do need it later for notify handler installation, since that is different for fixed hardware devices vs. namespace devices. This patch saves the device_type in the acpi_device structure, so we can check that rather than comparing against the _HID string. Signed-off-by: Bjorn Helgaas --- drivers/acpi/scan.c | 1 + include/acpi/acpi_bus.h | 3 ++- 2 files changed, 3 insertions(+), 1 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 ab5a264..c73681b 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1240,6 +1240,7 @@ acpi_add_single_object(struct acpi_device **child, return -ENOMEM; } + device->device_type = type; device->handle = handle; device->parent = parent; device->bus_ops = *ops; /* workround for not call .start */ diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 89bbb2a..8e39b3e 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -262,7 +262,8 @@ struct acpi_device_wakeup { /* Device */ struct acpi_device { - acpi_handle handle; + int device_type; + acpi_handle handle; /* no handle for fixed hardware */ struct acpi_device *parent; struct list_head children; struct list_head node;