mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-30 16:40:44 +09:00
net: eth-uclass: ignore unavailable devices
device_probe() may fail in which case the seq_id will be -1. Don't display these devices during startup. While this is only a cosmetic change, the return value of eth_initialize() will also change to the actual number of available devices. The return value is only used in spl_net to decide whether there are any devices to boot from. So returning only available devices is also more correct in that case. Signed-off-by: Michael Walle <michael@walle.cc> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
bf58916373
commit
19820db0bd
@ -420,20 +420,25 @@ int eth_initialize(void)
|
|||||||
|
|
||||||
bootstage_mark(BOOTSTAGE_ID_NET_ETH_INIT);
|
bootstage_mark(BOOTSTAGE_ID_NET_ETH_INIT);
|
||||||
do {
|
do {
|
||||||
if (num_devices)
|
if (dev->seq != -1) {
|
||||||
printf(", ");
|
if (num_devices)
|
||||||
|
printf(", ");
|
||||||
|
|
||||||
printf("eth%d: %s", dev->seq, dev->name);
|
printf("eth%d: %s", dev->seq, dev->name);
|
||||||
|
|
||||||
if (ethprime && dev == prime_dev)
|
if (ethprime && dev == prime_dev)
|
||||||
printf(" [PRIME]");
|
printf(" [PRIME]");
|
||||||
|
}
|
||||||
|
|
||||||
eth_write_hwaddr(dev);
|
eth_write_hwaddr(dev);
|
||||||
|
|
||||||
|
if (dev->seq != -1)
|
||||||
|
num_devices++;
|
||||||
uclass_next_device_check(&dev);
|
uclass_next_device_check(&dev);
|
||||||
num_devices++;
|
|
||||||
} while (dev);
|
} while (dev);
|
||||||
|
|
||||||
|
if (!num_devices)
|
||||||
|
printf("No ethernet found.\n");
|
||||||
putc('\n');
|
putc('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user