summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/device/pci_device.c25
-rw-r--r--src/device/pciexp_device.c4
2 files changed, 19 insertions, 10 deletions
diff --git a/src/device/pci_device.c b/src/device/pci_device.c
index ce3e50967a..691ad6b316 100644
--- a/src/device/pci_device.c
+++ b/src/device/pci_device.c
@@ -1006,16 +1006,11 @@ static struct device *pci_scan_get_dev(struct bus *bus, unsigned int devfn)
prev = &bus->children;
for (dev = bus->children; dev; dev = dev->sibling) {
- if (dev->path.type == DEVICE_PATH_PCI) {
- if (dev->path.pci.devfn == devfn) {
- /* Unlink from the list. */
- *prev = dev->sibling;
- dev->sibling = NULL;
- break;
- }
- } else {
- printk(BIOS_ERR, "child %s not a PCI device\n",
- dev_path(dev));
+ if (dev->path.type == DEVICE_PATH_PCI && dev->path.pci.devfn == devfn) {
+ /* Unlink from the list. */
+ *prev = dev->sibling;
+ dev->sibling = NULL;
+ break;
}
prev = &dev->sibling;
}
@@ -1283,6 +1278,16 @@ void pci_scan_bus(struct bus *bus, unsigned int min_devfn,
prev = &bus->children;
for (dev = bus->children; dev; dev = dev->sibling) {
+
+ /*
+ * If static device is not PCI then enable it here and don't
+ * treat it as a leftover device.
+ */
+ if (dev->path.type != DEVICE_PATH_PCI) {
+ enable_static_device(dev);
+ continue;
+ }
+
/*
* The device is only considered leftover if it is not hidden
* and it has a Vendor ID of 0 (the default for a device that
diff --git a/src/device/pciexp_device.c b/src/device/pciexp_device.c
index f04d865152..8d4bb9849d 100644
--- a/src/device/pciexp_device.c
+++ b/src/device/pciexp_device.c
@@ -180,6 +180,8 @@ static void pciexp_enable_ltr(struct device *dev)
for (bus = dev->link_list ; bus ; bus = bus->next) {
for (child = bus->children; child; child = child->sibling) {
+ if (child->path.type != DEVICE_PATH_PCI)
+ continue;
pciexp_configure_ltr(child);
if (child->ops && child->ops->scan_bus)
pciexp_enable_ltr(child);
@@ -478,6 +480,8 @@ void pciexp_scan_bus(struct bus *bus, unsigned int min_devfn,
pci_scan_bus(bus, min_devfn, max_devfn);
for (child = bus->children; child; child = child->sibling) {
+ if (child->path.type != DEVICE_PATH_PCI)
+ continue;
if ((child->path.pci.devfn < min_devfn) ||
(child->path.pci.devfn > max_devfn)) {
continue;