net: eth-uclass: eth_get_dev based on SEQ_ALIAS instead of probe order
In case of multiple eth interfaces currently eth_get_dev fetches the device based on the probe order which can be random hence try with the alias. Signed-off-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
This commit is contained in:
parent
51afd0146f
commit
bad069367c
|
|
@ -78,9 +78,14 @@ struct udevice *eth_get_dev(void)
|
||||||
if (!uc_priv)
|
if (!uc_priv)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!uc_priv->current)
|
if (!uc_priv->current) {
|
||||||
eth_errno = uclass_first_device(UCLASS_ETH,
|
eth_errno = uclass_get_device_by_seq(UCLASS_ETH, 0,
|
||||||
&uc_priv->current);
|
&uc_priv->current);
|
||||||
|
if (eth_errno || !uc_priv->current)
|
||||||
|
eth_errno = uclass_first_device(UCLASS_ETH,
|
||||||
|
&uc_priv->current);
|
||||||
|
}
|
||||||
|
|
||||||
return uc_priv->current;
|
return uc_priv->current;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue