--- drivers/acpi/pci_slot.c | 17 ++++++++++++++--- drivers/pci/hotplug/acpiphp_core.c | 8 +++++++- 2 files changed, 21 insertions(+), 4 deletions(-) Index: linux-2.6/drivers/acpi/pci_slot.c =================================================================== --- linux-2.6.orig/drivers/acpi/pci_slot.c +++ linux-2.6/drivers/acpi/pci_slot.c @@ -152,7 +152,10 @@ register_slot(acpi_handle handle, u32 lv } snprintf(name, sizeof(name), "%llu", sun); - pci_slot = pci_create_slot(pci_bus, device, name, NULL); + if (pci_bus->self) + pci_slot = __pci_create_slot(pci_bus->self, NULL, device, name, NULL); + else + pci_slot = pci_create_slot(pci_bus, device, name, NULL); if (IS_ERR(pci_slot)) { err("pci_create_slot returned %ld\n", PTR_ERR(pci_slot)); kfree(slot); @@ -166,7 +169,10 @@ register_slot(acpi_handle handle, u32 lv list_add(&slot->list, &slot_list); mutex_unlock(&slot_list_lock); - get_device(&pci_bus->dev); + if (pci_bus->self) + get_device(&pci_bus->self->dev); + else + get_device(&pci_bus->dev); dbg("pci_slot: %p, pci_bus: %x, device: %d, name: %s\n", pci_slot, pci_bus->number, device, name); @@ -315,14 +321,19 @@ acpi_pci_slot_remove(acpi_handle handle) { struct acpi_pci_slot *slot, *tmp; struct pci_bus *pbus; + struct pci_dev *b_dev; mutex_lock(&slot_list_lock); list_for_each_entry_safe(slot, tmp, &slot_list, list) { if (slot->root_handle == handle) { list_del(&slot->list); + b_dev = slot->pci_slot->b_dev; pbus = slot->pci_slot->bus; pci_destroy_slot(slot->pci_slot); - put_device(&pbus->dev); + if (b_dev) + put_device(&b_dev->dev); + else + put_device(&pbus->dev); kfree(slot); } } Index: linux-2.6/drivers/pci/hotplug/acpiphp_core.c =================================================================== --- linux-2.6.orig/drivers/pci/hotplug/acpiphp_core.c +++ linux-2.6/drivers/pci/hotplug/acpiphp_core.c @@ -315,7 +315,13 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot->slot = slot; snprintf(name, SLOT_NAME_SIZE, "%llu", slot->acpi_slot->sun); - retval = pci_hp_register(slot->hotplug_slot, + if (acpiphp_slot->bridge->pci_dev) + retval = pci_hp_register_bridge(slot->hotplug_slot, + acpiphp_slot->bridge->pci_dev, + acpiphp_slot->device, + name); + else + retval = pci_hp_register(slot->hotplug_slot, acpiphp_slot->bridge->pci_bus, acpiphp_slot->device, name);