From patchwork Mon Sep 21 19:35: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: 49109 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 n8LJZG9t009916 for ; Mon, 21 Sep 2009 19:35:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753364AbZIUTfH (ORCPT ); Mon, 21 Sep 2009 15:35:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753366AbZIUTfH (ORCPT ); Mon, 21 Sep 2009 15:35:07 -0400 Received: from g4t0017.houston.hp.com ([15.201.24.20]:48276 "EHLO g4t0017.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753364AbZIUTfG (ORCPT ); Mon, 21 Sep 2009 15:35:06 -0400 Received: from g4t0009.houston.hp.com (g4t0009.houston.hp.com [16.234.32.26]) by g4t0017.houston.hp.com (Postfix) with ESMTP id 0B00338058; Mon, 21 Sep 2009 19:35:10 +0000 (UTC) Received: from ldl (linux.corp.hp.com [15.11.146.101]) by g4t0009.houston.hp.com (Postfix) with ESMTP id BC613C030; Mon, 21 Sep 2009 19:35:09 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id A3170CF000E; Mon, 21 Sep 2009 13:35:09 -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 0AYPCbWFv-if; Mon, 21 Sep 2009 13:35:09 -0600 (MDT) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl (Postfix) with ESMTP id 8D497CF000D; Mon, 21 Sep 2009 13:35:09 -0600 (MDT) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id 84BE62615C; Mon, 21 Sep 2009 13:35:09 -0600 (MDT) Subject: [PATCH v3 2/8] ACPI: use acpi_device_hid() when possible 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:09 -0600 Message-ID: <20090921193509.21656.63871.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 Use acpi_device_hid() rather than accessing acpi_device.pnp.hardware_id directly. Signed-off-by: Bjorn Helgaas --- drivers/acpi/scan.c | 6 +++--- drivers/pnp/pnpacpi/core.c | 2 +- 2 files changed, 4 insertions(+), 4 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 e9227ea..269c0aa 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -185,7 +185,7 @@ static ssize_t acpi_device_hid_show(struct device *dev, struct device_attribute *attr, char *buf) { struct acpi_device *acpi_dev = to_acpi_device(dev); - return sprintf(buf, "%s\n", acpi_dev->pnp.hardware_id); + return sprintf(buf, "%s\n", acpi_device_hid(acpi_dev)); } static DEVICE_ATTR(hid, 0444, acpi_device_hid_show, NULL); @@ -501,7 +501,7 @@ static int acpi_device_register(struct acpi_device *device) * If failed, create one and link it into acpi_bus_id_list */ list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node) { - if(!strcmp(acpi_device_bus_id->bus_id, device->flags.hardware_id? device->pnp.hardware_id : "device")) { + if (!strcmp(acpi_device_bus_id->bus_id, device->flags.hardware_id ? acpi_device_hid(device) : "device")) { acpi_device_bus_id->instance_no ++; found = 1; kfree(new_bus_id); @@ -510,7 +510,7 @@ static int acpi_device_register(struct acpi_device *device) } if (!found) { acpi_device_bus_id = new_bus_id; - strcpy(acpi_device_bus_id->bus_id, device->flags.hardware_id ? device->pnp.hardware_id : "device"); + strcpy(acpi_device_bus_id->bus_id, device->flags.hardware_id ? acpi_device_hid(device) : "device"); acpi_device_bus_id->instance_no = 0; list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list); } diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index c07fdb9..ff963d4 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c @@ -234,7 +234,7 @@ static int __init acpi_pnp_match(struct device *dev, void *_pnp) /* true means it matched */ return acpi->flags.hardware_id && !acpi_get_physical_device(acpi->handle) - && compare_pnp_id(pnp->id, acpi->pnp.hardware_id); + && compare_pnp_id(pnp->id, acpi_device_hid(acpi)); } static int __init acpi_pnp_find_device(struct device *dev, acpi_handle * handle)