diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2006-05-11 22:22:24 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-19 17:13:23 -0400 |
commit | 56bfada3e1a25c0da6f4590a4b04c67ec10910c2 (patch) | |
tree | 14df15811b0aed4b66ecdec8476b9edbda8d738b /drivers | |
parent | 466ee36b62b4b294ecf68a2eee2e18c6ff8c9be4 (diff) |
[PATCH] pciehp: Replace pci_find_slot() with pci_get_slot()
This patch replaces pci_find_slot() with pci_get_slot() in PCIEHP
driver. This patch enables PCI Express Hotplug on the system which has
multiple PCI domains.
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Cc: Kristen Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/hotplug/pciehp_pci.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c index 6aa6a1be455..922b1831c68 100644 --- a/drivers/pci/hotplug/pciehp_pci.c +++ b/drivers/pci/hotplug/pciehp_pci.c | |||
@@ -204,10 +204,11 @@ int pciehp_configure_device(struct slot *p_slot) | |||
204 | struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate; | 204 | struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate; |
205 | int num, fn; | 205 | int num, fn; |
206 | 206 | ||
207 | dev = pci_find_slot(p_slot->bus, PCI_DEVFN(p_slot->device, 0)); | 207 | dev = pci_get_slot(parent, PCI_DEVFN(p_slot->device, 0)); |
208 | if (dev) { | 208 | if (dev) { |
209 | err("Device %s already exists at %x:%x, cannot hot-add\n", | 209 | err("Device %s already exists at %x:%x, cannot hot-add\n", |
210 | pci_name(dev), p_slot->bus, p_slot->device); | 210 | pci_name(dev), p_slot->bus, p_slot->device); |
211 | pci_dev_put(dev); | ||
211 | return -EINVAL; | 212 | return -EINVAL; |
212 | } | 213 | } |
213 | 214 | ||
@@ -243,18 +244,20 @@ int pciehp_unconfigure_device(struct slot *p_slot) | |||
243 | int rc = 0; | 244 | int rc = 0; |
244 | int j; | 245 | int j; |
245 | u8 bctl = 0; | 246 | u8 bctl = 0; |
247 | struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate; | ||
246 | 248 | ||
247 | dbg("%s: bus/dev = %x/%x\n", __FUNCTION__, p_slot->bus, | 249 | dbg("%s: bus/dev = %x/%x\n", __FUNCTION__, p_slot->bus, |
248 | p_slot->device); | 250 | p_slot->device); |
249 | 251 | ||
250 | for (j=0; j<8 ; j++) { | 252 | for (j=0; j<8 ; j++) { |
251 | struct pci_dev* temp = pci_find_slot(p_slot->bus, | 253 | struct pci_dev* temp = pci_get_slot(parent, |
252 | (p_slot->device << 3) | j); | 254 | (p_slot->device << 3) | j); |
253 | if (!temp) | 255 | if (!temp) |
254 | continue; | 256 | continue; |
255 | if ((temp->class >> 16) == PCI_BASE_CLASS_DISPLAY) { | 257 | if ((temp->class >> 16) == PCI_BASE_CLASS_DISPLAY) { |
256 | err("Cannot remove display device %s\n", | 258 | err("Cannot remove display device %s\n", |
257 | pci_name(temp)); | 259 | pci_name(temp)); |
260 | pci_dev_put(temp); | ||
258 | continue; | 261 | continue; |
259 | } | 262 | } |
260 | if (temp->hdr_type == PCI_HEADER_TYPE_BRIDGE) { | 263 | if (temp->hdr_type == PCI_HEADER_TYPE_BRIDGE) { |
@@ -262,10 +265,12 @@ int pciehp_unconfigure_device(struct slot *p_slot) | |||
262 | if (bctl & PCI_BRIDGE_CTL_VGA) { | 265 | if (bctl & PCI_BRIDGE_CTL_VGA) { |
263 | err("Cannot remove display device %s\n", | 266 | err("Cannot remove display device %s\n", |
264 | pci_name(temp)); | 267 | pci_name(temp)); |
268 | pci_dev_put(temp); | ||
265 | continue; | 269 | continue; |
266 | } | 270 | } |
267 | } | 271 | } |
268 | pci_remove_bus_device(temp); | 272 | pci_remove_bus_device(temp); |
273 | pci_dev_put(temp); | ||
269 | } | 274 | } |
270 | /* | 275 | /* |
271 | * Some PCI Express root ports require fixup after hot-plug operation. | 276 | * Some PCI Express root ports require fixup after hot-plug operation. |