From patchwork Fri Jul 31 21:37:09 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 38601 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 n6VLbBI9017264 for ; Fri, 31 Jul 2009 21:37:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752832AbZGaVhL (ORCPT ); Fri, 31 Jul 2009 17:37:11 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753160AbZGaVhL (ORCPT ); Fri, 31 Jul 2009 17:37:11 -0400 Received: from g1t0028.austin.hp.com ([15.216.28.35]:43727 "EHLO g1t0028.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752832AbZGaVhJ (ORCPT ); Fri, 31 Jul 2009 17:37:09 -0400 Received: from g1t0039.austin.hp.com (g1t0039.austin.hp.com [16.236.32.45]) by g1t0028.austin.hp.com (Postfix) with ESMTP id C34F31C590; Fri, 31 Jul 2009 21:37:10 +0000 (UTC) Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30]) by g1t0039.austin.hp.com (Postfix) with ESMTP id AE6B73412C; Fri, 31 Jul 2009 21:37:10 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl.fc.hp.com (Postfix) with ESMTP id 7713339C008; Fri, 31 Jul 2009 15:37:10 -0600 (MDT) X-Virus-Scanned: Debian amavisd-new at ldl.fc.hp.com Received: from ldl.fc.hp.com ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HCs3e-IQiH3k; Fri, 31 Jul 2009 15:37:09 -0600 (MDT) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl.fc.hp.com (Postfix) with ESMTP id 357EA39C003; Fri, 31 Jul 2009 15:37:09 -0600 (MDT) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id 293F326169; Fri, 31 Jul 2009 15:37:09 -0600 (MDT) Subject: [PATCH 07/19] ACPI: save device_type in acpi_device To: Len Brown From: Bjorn Helgaas Cc: linux-acpi@vger.kernel.org Date: Fri, 31 Jul 2009 15:37:09 -0600 Message-ID: <20090731213709.29930.57436.stgit@bob.kio> In-Reply-To: <20090731213501.29930.39957.stgit@bob.kio> References: <20090731213501.29930.39957.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 aade372..b386589 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1188,6 +1188,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 79a6c5e..b145270 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -266,7 +266,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;