From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org, pcihpd-discuss@lists.sourceforge.net
Subject: [PATCH] PCI hotplug changes for 2.5.58
Date: Tue, 14 Jan 2003 14:19:44 -0800 [thread overview]
Message-ID: <20030114221944.GD17226@kroah.com> (raw)
In-Reply-To: <20030114221839.GC17226@kroah.com>
ChangeSet 1.1025, 2003/01/14 11:30:32-08:00, willy@debian.org
[PATCH] acpi_bus_register_driver patch
The current ACPI code searches for a _HID of PNP0A03. This is wrong,
it needs to check _CID too. But we already have generic code for doing
that, so this patch converts the ACPI pcihp code to do this.
diff -Nru a/drivers/hotplug/acpiphp_glue.c b/drivers/hotplug/acpiphp_glue.c
--- a/drivers/hotplug/acpiphp_glue.c Tue Jan 14 14:11:54 2003
+++ b/drivers/hotplug/acpiphp_glue.c Tue Jan 14 14:11:54 2003
@@ -712,8 +712,9 @@
/* find hot-pluggable slots, and then find P2P bridge */
-static int add_bridges (acpi_handle *handle)
+static int add_bridges(struct acpi_device *device)
{
+ acpi_handle *handle = device->handle;
acpi_status status;
unsigned long tmp;
int seg, bus;
@@ -767,36 +768,6 @@
}
-/* callback routine to enumerate all the bridges in ACPI namespace */
-static acpi_status
-find_host_bridge (acpi_handle handle, u32 lvl, void *context, void **rv)
-{
- acpi_status status;
- struct acpi_device_info info;
- char objname[5];
- struct acpi_buffer buffer = { .length = sizeof(objname),
- .pointer = objname };
-
- status = acpi_get_object_info(handle, &info);
- if (ACPI_FAILURE(status)) {
- dbg("%s: failed to get bridge information\n", __FUNCTION__);
- return AE_OK; /* continue */
- }
-
- info.hardware_id[sizeof(info.hardware_id)-1] = '\0';
-
- /* TBD use acpi_get_devices() API */
- if (info.current_status &&
- (info.valid & ACPI_VALID_HID) &&
- strcmp(info.hardware_id, ACPI_PCI_HOST_HID) == 0) {
- acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer);
- dbg("checking PCI-hotplug capable bridges under [%s]\n", objname);
- add_bridges(handle);
- }
- return AE_OK;
-}
-
-
static int power_on_slot (struct acpiphp_slot *slot)
{
acpi_status status;
@@ -1157,6 +1128,14 @@
}
}
+static struct acpi_driver acpi_pci_hp_driver = {
+ .name = "pci_hp",
+ .class = "",
+ .ids = ACPI_PCI_HOST_HID,
+ .ops = {
+ .add = add_bridges,
+ }
+};
/**
* acpiphp_glue_init - initializes all PCI hotplug - ACPI glue data structures
@@ -1169,9 +1148,7 @@
if (list_empty(&pci_root_buses))
return -1;
- status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
- ACPI_UINT32_MAX, find_host_bridge,
- NULL, NULL);
+ status = acpi_bus_register_driver(&acpi_pci_hp_driver);
if (ACPI_FAILURE(status)) {
err("%s: acpi_walk_namespace() failed\n", __FUNCTION__);
prev parent reply other threads:[~2003-01-14 22:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-14 22:18 [BK PATCH] PCI hotplug changes for 2.5.58 Greg KH
2003-01-14 22:19 ` Greg KH [this message]
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=20030114221944.GD17226@kroah.com \
--to=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pcihpd-discuss@lists.sourceforge.net \
/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