From: Andrew Patterson <andrew.patterson@hp.com>
To: linux-pci@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, lenb@kernel.org, gregkh@suse.de,
matthew@wil.cx, tom.l.nguyen@intel.com,
linux-acpi@vger.kernel.org,
Andrew Patterson <andrew.patterson@hp.com>
Subject: [PATCH 3/4] ACPI: Check for any matching CID when walking namespace.
Date: Tue, 22 Jan 2008 17:18:22 -0700 [thread overview]
Message-ID: <20080123001822.28190.3147.stgit@bluto.andrew> (raw)
In-Reply-To: <20080123001807.28190.32648.stgit@bluto.andrew>
From: Andrew Patterson <andrew.patterson@hp.com>
The callback function acpi_ns_get_device_callback called from
acpi_get_devices() will check CID's if the HID does not match. This code
has a bug where it requires that all CIDs match the HID. Changed the code
so that any CID match will do.
Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
---
drivers/acpi/namespace/nsxfeval.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c
index f39fbc6..e562b24 100644
--- a/drivers/acpi/namespace/nsxfeval.c
+++ b/drivers/acpi/namespace/nsxfeval.c
@@ -443,6 +443,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
struct acpica_device_id hid;
struct acpi_compatible_id_list *cid;
acpi_native_uint i;
+ int found;
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE(status)) {
@@ -496,16 +497,20 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
/* Walk the CID list */
+ found = 0;
for (i = 0; i < cid->count; i++) {
if (ACPI_STRNCMP(cid->id[i].value, info->hid,
sizeof(struct
- acpi_compatible_id)) !=
+ acpi_compatible_id)) ==
0) {
- ACPI_FREE(cid);
- return (AE_OK);
+ found = 1;
+ break;
}
}
ACPI_FREE(cid);
+ if (!found) {
+ return (AE_OK);
+ }
}
}
next prev parent reply other threads:[~2008-01-23 0:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-23 0:18 [PATCH 0/4] ACPI fixes for PCIe AER Andrew Patterson
2008-01-23 0:18 ` [PATCH 1/4] PCI ACPI: Added a function to register _OSC with only PCIe devices Andrew Patterson
2008-01-23 0:18 ` [PATCH 2/4] PCI ACPI: AER driver should only register PCIe devices with _OSC Andrew Patterson
2008-01-23 0:18 ` Andrew Patterson [this message]
2008-01-23 17:42 ` [PATCH 3/4] ACPI: Check for any matching CID when walking namespace Greg KH
2008-01-23 19:35 ` Andrew Patterson
2008-01-23 19:39 ` Len Brown
2008-01-23 19:48 ` Andrew Patterson
2008-02-12 23:38 ` Moore, Robert
2008-01-23 0:18 ` [PATCH 4/4] PCI: Run ACPI _OSC method on root bridges only Andrew Patterson
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=20080123001822.28190.3147.stgit@bluto.andrew \
--to=andrew.patterson@hp.com \
--cc=gregkh@suse.de \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=tom.l.nguyen@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