aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/probe.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 6a198fc65999..e9482867555b 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1386,6 +1386,29 @@ void pci_configure_slot(struct pci_dev *dev)
1386} 1386}
1387EXPORT_SYMBOL_GPL(pci_configure_slot); 1387EXPORT_SYMBOL_GPL(pci_configure_slot);
1388 1388
1389static void pci_configure_device(struct pci_dev *dev)
1390{
1391 struct hotplug_params hpp;
1392 int ret;
1393
1394 if (system_state == SYSTEM_BOOTING)
1395 return;
1396
1397 if (!(dev->hdr_type == PCI_HEADER_TYPE_NORMAL ||
1398 (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE &&
1399 (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI)))
1400 return;
1401
1402 memset(&hpp, 0, sizeof(hpp));
1403 ret = pci_get_hp_params(dev, &hpp);
1404 if (ret)
1405 return;
1406
1407 program_hpp_type2(dev, hpp.t2);
1408 program_hpp_type1(dev, hpp.t1);
1409 program_hpp_type0(dev, hpp.t0);
1410}
1411
1389static void pci_release_capabilities(struct pci_dev *dev) 1412static void pci_release_capabilities(struct pci_dev *dev)
1390{ 1413{
1391 pci_vpd_release(dev); 1414 pci_vpd_release(dev);
@@ -1523,6 +1546,8 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
1523{ 1546{
1524 int ret; 1547 int ret;
1525 1548
1549 pci_configure_device(dev);
1550
1526 device_initialize(&dev->dev); 1551 device_initialize(&dev->dev);
1527 dev->dev.release = pci_release_dev; 1552 dev->dev.release = pci_release_dev;
1528 1553