aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/pciehp_pci.c
diff options
context:
space:
mode:
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