[U-Boot] [PATCH u-boot] pci: ensure enumeration of all devices in pci_init

Marek BehĂșn marek.behun at nic.cz
Tue May 21 10:04:31 UTC 2019


Use the uclass_first_device_check and uclass_next_device_check functions
instead of uclass_first_device and uclass_next_device in pci_init. This
ensures that all PCI devices are tried to be probed. Currently if a
device fails to probe, the enumeration stops and the devices which come
after the failed device are not probed.

Signed-off-by: Marek BehĂșn <marek.behun at nic.cz>
Cc: Stefan Roese <sr at denx.de>
Cc: Anton Schubert <anton.schubert at gmx.de>
Cc: Dirk Eibach <dirk.eibach at gdsys.cc>
Cc: Mario Six <mario.six at gdsys.cc>
Cc: Chris Packham <chris.packham at alliedtelesis.co.nz>
Cc: Phil Sutter <phil at nwl.cc>
Cc: VlaoMao <vlaomao at gmail.com>
Cc: Tom Rini <trini at konsulko.com>
---
 drivers/pci/pci-uclass.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index cf1e7617ae..dac7cd3e17 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -1502,9 +1502,9 @@ void pci_init(void)
 	 * Enumerate all known controller devices. Enumeration has the side-
 	 * effect of probing them, so PCIe devices will be enumerated too.
 	 */
-	for (uclass_first_device(UCLASS_PCI, &bus);
+	for (uclass_first_device_check(UCLASS_PCI, &bus);
 	     bus;
-	     uclass_next_device(&bus)) {
+	     uclass_next_device_check(&bus)) {
 		;
 	}
 }
-- 
2.21.0



More information about the U-Boot mailing list