From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Wed, 16 Dec 2020 21:20:16 -0700 Subject: [PATCH v3 11/28] net: Update to use new sequence numbers In-Reply-To: <20201217042034.411902-1-sjg@chromium.org> References: <20201217042034.411902-1-sjg@chromium.org> Message-ID: <20201217042034.411902-10-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- (no changes since v1) drivers/net/dwc_eth_qos.c | 2 +- net/eth-uclass.c | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c index 1569c5b4ea3..45a1648ad50 100644 --- a/drivers/net/dwc_eth_qos.c +++ b/drivers/net/dwc_eth_qos.c @@ -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); } diff --git a/net/eth-uclass.c b/net/eth-uclass.c index fad9770e74f..4eee0113eb1 100644 --- a/net/eth-uclass.c +++ b/net/eth-uclass.c @@ -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(). @@ -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(", "); @@ -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); -- 2.29.2.684.gfbc64c5ab5-goog