From d9e7393bc6cbb61a97f460965f2160caae7253c8 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 13 Feb 2008 13:32:24 -0800 Subject: [PATCH] --- yaml --- r: 91666 b: refs/heads/master c: 33ae6ef26d65ef5d15e80d95a9df1252eaed93e8 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/pci/hotplug/Kconfig | 2 +- trunk/drivers/pci/hotplug/cpcihp_generic.c | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 4495809c38cb..4922ff9705f3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 95247b57ed844511a212265b45cf9a919753aea1 +refs/heads/master: 33ae6ef26d65ef5d15e80d95a9df1252eaed93e8 diff --git a/trunk/drivers/pci/hotplug/Kconfig b/trunk/drivers/pci/hotplug/Kconfig index 2cdd8326f136..17fb3d6b7c73 100644 --- a/trunk/drivers/pci/hotplug/Kconfig +++ b/trunk/drivers/pci/hotplug/Kconfig @@ -119,7 +119,7 @@ config HOTPLUG_PCI_CPCI_ZT5550 config HOTPLUG_PCI_CPCI_GENERIC tristate "Generic port I/O CompactPCI Hotplug driver" - depends on HOTPLUG_PCI_CPCI && X86 && PCI_LEGACY + depends on HOTPLUG_PCI_CPCI && X86 help Say Y here if you have a CompactPCI system card that exposes the #ENUM hotswap signal as a bit in a system register that can be read through diff --git a/trunk/drivers/pci/hotplug/cpcihp_generic.c b/trunk/drivers/pci/hotplug/cpcihp_generic.c index f3852a6b74ea..148fb463b81c 100644 --- a/trunk/drivers/pci/hotplug/cpcihp_generic.c +++ b/trunk/drivers/pci/hotplug/cpcihp_generic.c @@ -154,12 +154,18 @@ static int __init cpcihp_generic_init(void) if(!r) return -EBUSY; - dev = pci_find_slot(bridge_busnr, PCI_DEVFN(bridge_slot, 0)); + bus = pci_find_bus(0, bridge_busnr); + if (!bus) { + err("Invalid bus number %d", bridge_busnr); + return -EINVAL; + } + dev = pci_get_slot(bus, PCI_DEVFN(bridge_slot, 0)); if(!dev || dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) { err("Invalid bridge device %s", bridge); return -EINVAL; } bus = dev->subordinate; + pci_dev_put(dev); memset(&generic_hpc, 0, sizeof (struct cpci_hp_controller)); generic_hpc_ops.query_enum = query_enum;