net: Initialize as many ethernet devices as possible
authorMario Six <mario.six@gdsys.cc>
Fri, 27 Apr 2018 12:52:56 +0000 (14:52 +0200)
committerJoe Hershberger <joe.hershberger@ni.com>
Wed, 13 Jun 2018 18:54:15 +0000 (13:54 -0500)
On devices that have their first network interface provided by a FPGA,
the initialization of further interfaces will fail if the FPGA is not
yet programmed. This leads to problems during factory setup when the
data is supposed to be loaded over secondary netowork interfaces.

To avoid this, use the uclass_{first,next}_device_check functions to
initialize as many ethernet devices as possible.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
net/eth-uclass.c

index d20a1cf160766081b4d743bad7479e3b72cda937..e4b49229e38d02936f668ed18b2fa53bceee3191 100644 (file)
@@ -395,7 +395,7 @@ int eth_initialize(void)
         * This is accomplished by attempting to probe each device and calling
         * their write_hwaddr() operation.
         */
-       uclass_first_device(UCLASS_ETH, &dev);
+       uclass_first_device_check(UCLASS_ETH, &dev);
        if (!dev) {
                printf("No ethernet found.\n");
                bootstage_error(BOOTSTAGE_ID_NET_ETH_START);
@@ -424,7 +424,7 @@ int eth_initialize(void)
 
                        eth_write_hwaddr(dev);
 
-                       uclass_next_device(&dev);
+                       uclass_next_device_check(&dev);
                        num_devices++;
                } while (dev);