pci: ensure enumeration of all devices in pci_init
authorMarek Behún <marek.behun@nic.cz>
Tue, 21 May 2019 10:04:31 +0000 (12:04 +0200)
committerTom Rini <trini@konsulko.com>
Sat, 13 Jul 2019 01:07:58 +0000 (21:07 -0400)
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@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Anton Schubert <anton.schubert@gmx.de>
Cc: Dirk Eibach <dirk.eibach@gdsys.cc>
Cc: Mario Six <mario.six@gdsys.cc>
Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>
Cc: Phil Sutter <phil@nwl.cc>
Cc: VlaoMao <vlaomao@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
drivers/pci/pci-uclass.c

index c74ebf6a7635c7579351049c289cca0de308066d..ab3e1310eb546d030139d8ead14094890b7cff35 100644 (file)
@@ -1572,9 +1572,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)) {
                ;
        }
 }