Skip to content
Snippets Groups Projects
Commit a6cd597a authored by Michael Walle's avatar Michael Walle Committed by Tom Rini
Browse files

drivers: pci: ignore disabled devices


PCI devices may be disabled in the device tree. Devices which are probed
by the device tree handle the "status" property and are skipped if
disabled. Devices which are probed by the PCI enumeration don't check
that property. Fix it.

Signed-off-by: default avatarMichael Walle <michael@walle.cc>
Reviewed-by: default avatarAlex Marginean <alexandru.marginean@nxp.com>
Tested-by: default avatarAlex Marginean <alexandru.marginean@nxp.com>
Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
parent 7e5ee346
No related branches found
No related tags found
No related merge requests found
......@@ -677,6 +677,11 @@ static int pci_find_and_bind_driver(struct udevice *parent,
/* Determine optional OF node */
pci_dev_find_ofnode(parent, bdf, &node);
if (ofnode_valid(node) && !ofnode_is_available(node)) {
debug("%s: Ignoring disabled device\n", __func__);
return -EPERM;
}
start = ll_entry_start(struct pci_driver_entry, pci_driver_entry);
n_ents = ll_entry_count(struct pci_driver_entry, pci_driver_entry);
for (entry = start; entry != start + n_ents; entry++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment