Skip to content

Commit

Permalink
net: Update to use new sequence numbers
Browse files Browse the repository at this point in the history
Checking for seq == -1 is effectively checking that the device is
activated. The new sequence numbers are never -1 for a bound device, so
update the check.

Also drop the note about valid sequence numbers so it is accurate with the
new approach.

Signed-off-by: Simon Glass <sjg@chromium.org>
  • Loading branch information
sjg20 committed Dec 19, 2020
1 parent 16df993 commit 552da33
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion drivers/net/dwc_eth_qos.c
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ static int eqos_read_rom_hwaddr(struct udevice *dev)
struct eth_pdata *pdata = dev_get_plat(dev);

#ifdef CONFIG_ARCH_IMX8M
imx_get_mac_from_fuse(dev->req_seq, pdata->enetaddr);
imx_get_mac_from_fuse(dev_seq(dev), pdata->enetaddr);
#endif
return !is_valid_ethaddr(pdata->enetaddr);
}
Expand Down
7 changes: 2 additions & 5 deletions net/eth-uclass.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ struct udevice *eth_get_dev_by_name(const char *devname)

uclass_foreach_dev(it, uc) {
/*
* We need the seq to be valid, so try to probe it.
* If the probe fails, the seq will not match since it will be
* -1 instead of what we are looking for.
* We don't care about errors from probe here. Either they won't
* match an alias or it will match a literal name and we'll pick
* up the error when we try to probe again in eth_set_dev().
Expand Down Expand Up @@ -434,7 +431,7 @@ int eth_initialize(void)

bootstage_mark(BOOTSTAGE_ID_NET_ETH_INIT);
do {
if (dev_seq(dev) != -1) {
if (device_active(dev)) {
if (num_devices)
printf(", ");

Expand All @@ -446,7 +443,7 @@ int eth_initialize(void)

eth_write_hwaddr(dev);

if (dev_seq(dev) != -1)
if (device_active(dev))
num_devices++;
uclass_next_device_check(&dev);
} while (dev);
Expand Down

0 comments on commit 552da33

Please sign in to comment.