aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/pciehp_pci.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-12 18:50:23 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-12 18:50:23 -0400
commit6a84258e5f5bb8b9bd72e06a5837fa6fdacaf5c5 (patch)
tree3c4911a489c85e908b0ef3ed83d78264788f858c /drivers/pci/hotplug/pciehp_pci.c
parentefefc6eb38d43b8e5daef482f575d767b002004e (diff)
parentf3e6f164c2389853432454c89b316a8ab7485e2f (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6: (37 commits) PCI: merge almost all of pci_32.h and pci_64.h together PCI: X86: Introduce and enable PCI domain support PCI: Add 'nodomains' boot option, and pci_domains_supported global PCI: modify PCI bridge control ISA flag for clarity PCI: use _CRS for PCI resource allocation PCI: avoid P2P prefetch window for expansion ROMs PCI: skip ISA ioresource alignment on some systems PCI: remove transparent bridge sizing pci: write file size to inode on proc bus file write pci: use size stored in proc_dir_entry for proc bus files pci: implement "pci=noaer" PCI: fix IDE legacy mode resources MSI: Use correct data offset for 32-bit MSI in read_msi_msg() PCI: Fix incorrect argument order to list_add_tail() in PCI dynamic ID code PCI: i386: Compaq EVO N800c needs PCI bus renumbering PCI: Remove no longer correct documentation regarding MSI vector assignment PCI: re-enable onboard sound on "MSI K8T Neo2-FIR" PCI: quirk_vt82c586_acpi: Omit reading PCI revision ID PCI: quirk amd_8131_mmrbc: Omit reading pci revision ID cpqphp: Use PCI_CLASS_REVISION instead of PCI_REVISION_ID for read ...
Diffstat (limited to 'drivers/pci/hotplug/pciehp_pci.c')
-rw-r--r--drivers/pci/hotplug/pciehp_pci.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c
index 854aaea09e4d..c424aded13fb 100644
--- a/drivers/pci/hotplug/pciehp_pci.c
+++ b/drivers/pci/hotplug/pciehp_pci.c
@@ -243,9 +243,10 @@ int pciehp_configure_device(struct slot *p_slot)
243 243
244int pciehp_unconfigure_device(struct slot *p_slot) 244int pciehp_unconfigure_device(struct slot *p_slot)
245{ 245{
246 int rc = 0; 246 int ret, rc = 0;
247 int j; 247 int j;
248 u8 bctl = 0; 248 u8 bctl = 0;
249 u8 presence = 0;
249 struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate; 250 struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate;
250 251
251 dbg("%s: bus/dev = %x/%x\n", __FUNCTION__, p_slot->bus, 252 dbg("%s: bus/dev = %x/%x\n", __FUNCTION__, p_slot->bus,
@@ -263,23 +264,28 @@ int pciehp_unconfigure_device(struct slot *p_slot)
263 continue; 264 continue;
264 } 265 }
265 if (temp->hdr_type == PCI_HEADER_TYPE_BRIDGE) { 266 if (temp->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
266 pci_read_config_byte(temp, PCI_BRIDGE_CONTROL, &bctl); 267 ret = p_slot->hpc_ops->get_adapter_status(p_slot,
267 if (bctl & PCI_BRIDGE_CTL_VGA) { 268 &presence);
268 err("Cannot remove display device %s\n", 269 if (!ret && presence) {
270 pci_read_config_byte(temp, PCI_BRIDGE_CONTROL,
271 &bctl);
272 if (bctl & PCI_BRIDGE_CTL_VGA) {
273 err("Cannot remove display device %s\n",
269 pci_name(temp)); 274 pci_name(temp));
270 pci_dev_put(temp); 275 pci_dev_put(temp);
271 continue; 276 continue;
277 }
272 } 278 }
273 } 279 }
274 pci_remove_bus_device(temp); 280 pci_remove_bus_device(temp);
275 pci_dev_put(temp); 281 pci_dev_put(temp);
276 } 282 }
277 /* 283 /*
278 * Some PCI Express root ports require fixup after hot-plug operation. 284 * Some PCI Express root ports require fixup after hot-plug operation.
279 */ 285 */
280 if (pcie_mch_quirk) 286 if (pcie_mch_quirk)
281 pci_fixup_device(pci_fixup_final, p_slot->ctrl->pci_dev); 287 pci_fixup_device(pci_fixup_final, p_slot->ctrl->pci_dev);
282 288
283 return rc; 289 return rc;
284} 290}
285 291