summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-06-28 16:22:13 -0400
committerTom Rini <trini@konsulko.com>2021-06-28 16:22:13 -0400
commit6d0453d88915feeece6e55748a2476d8509e5fad (patch)
treef4564a64f771cb071a74787f11471250fdbdf47b /net
parent67edf2553f15e5148efca213af3f41cef3410680 (diff)
parent3ef4572110a43acdd7d401b0cb184c6ebd6eaa17 (diff)
downloadu-boot-socfpga-6d0453d88915feeece6e55748a2476d8509e5fad.tar.gz
Merge tag 'v2021.07-rc5' into next
Prepare v2021.07-rc5 # gpg: Signature made Mon 28 Jun 2021 03:39:36 PM EDT # gpg: using RSA key 1A3C7F70E08FAB1707809BBF147C39FF9634B72C # gpg: Good signature from "Thomas Rini <trini@konsulko.com>" [ultimate] # Conflicts: # configs/am64x_evm_r5_defconfig
Diffstat (limited to 'net')
-rw-r--r--net/eth-uclass.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/net/eth-uclass.c b/net/eth-uclass.c
index 34ca731d1e..5146bd6666 100644
--- a/net/eth-uclass.c
+++ b/net/eth-uclass.c
@@ -69,8 +69,11 @@ void eth_set_current_to_next(void)
/*
* Typically this will simply return the active device.
* In the case where the most recent active device was unset, this will attempt
- * to return the first device. If that device doesn't exist or fails to probe,
- * this function will return NULL.
+ * to return the device with sequence id 0 (which can be configured by the
+ * device tree). If this fails, fall back to just getting the first device.
+ * The latter is non-deterministic and depends on the order of the probing.
+ * If that device doesn't exist or fails to probe, this function will return
+ * NULL.
*/
struct udevice *eth_get_dev(void)
{
@@ -80,9 +83,13 @@ struct udevice *eth_get_dev(void)
if (!uc_priv)
return NULL;
- if (!uc_priv->current)
- eth_errno = uclass_first_device(UCLASS_ETH,
- &uc_priv->current);
+ if (!uc_priv->current) {
+ eth_errno = uclass_get_device_by_seq(UCLASS_ETH, 0,
+ &uc_priv->current);
+ if (eth_errno)
+ eth_errno = uclass_first_device(UCLASS_ETH,
+ &uc_priv->current);
+ }
return uc_priv->current;
}
@@ -598,8 +605,8 @@ static int eth_pre_remove(struct udevice *dev)
return 0;
}
-UCLASS_DRIVER(eth) = {
- .name = "eth",
+UCLASS_DRIVER(ethernet) = {
+ .name = "ethernet",
.id = UCLASS_ETH,
.post_bind = eth_post_bind,
.pre_unbind = eth_pre_unbind,