diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-13 16:32:24 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-21 00:46:56 -0400 |
commit | 33ae6ef26d65ef5d15e80d95a9df1252eaed93e8 (patch) | |
tree | 31f614b654220ec754e00856166b87673baae052 /drivers/pci/hotplug/cpcihp_generic.c | |
parent | 95247b57ed844511a212265b45cf9a919753aea1 (diff) |
PCI Hotplug: make cpcihp driver use modern apis
This removes the depandancy of the cpcihp driver from the PCI_LEGACY
config option by removing its usage of the pci_find_bus() function.
Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Scott Murray <scottm@somanetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/cpcihp_generic.c')
-rw-r--r-- | drivers/pci/hotplug/cpcihp_generic.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/cpcihp_generic.c b/drivers/pci/hotplug/cpcihp_generic.c index f3852a6b74ea..148fb463b81c 100644 --- a/drivers/pci/hotplug/cpcihp_generic.c +++ b/drivers/pci/hotplug/cpcihp_generic.c | |||
@@ -154,12 +154,18 @@ static int __init cpcihp_generic_init(void) | |||
154 | if(!r) | 154 | if(!r) |
155 | return -EBUSY; | 155 | return -EBUSY; |
156 | 156 | ||
157 | dev = pci_find_slot(bridge_busnr, PCI_DEVFN(bridge_slot, 0)); | 157 | bus = pci_find_bus(0, bridge_busnr); |
158 | if (!bus) { | ||
159 | err("Invalid bus number %d", bridge_busnr); | ||
160 | return -EINVAL; | ||
161 | } | ||
162 | dev = pci_get_slot(bus, PCI_DEVFN(bridge_slot, 0)); | ||
158 | if(!dev || dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) { | 163 | if(!dev || dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) { |
159 | err("Invalid bridge device %s", bridge); | 164 | err("Invalid bridge device %s", bridge); |
160 | return -EINVAL; | 165 | return -EINVAL; |
161 | } | 166 | } |
162 | bus = dev->subordinate; | 167 | bus = dev->subordinate; |
168 | pci_dev_put(dev); | ||
163 | 169 | ||
164 | memset(&generic_hpc, 0, sizeof (struct cpci_hp_controller)); | 170 | memset(&generic_hpc, 0, sizeof (struct cpci_hp_controller)); |
165 | generic_hpc_ops.query_enum = query_enum; | 171 | generic_hpc_ops.query_enum = query_enum; |