net: use a more deterministic approach to get the active ethernet device
authorMichael Walle <michael@walle.cc>
Wed, 24 Feb 2021 16:30:44 +0000 (17:30 +0100)
committerRamon Fried <rfried.dev@gmail.com>
Fri, 18 Jun 2021 08:29:17 +0000 (11:29 +0300)
commit6e424b4acac0dba486a97ecd80a78aa0fea43683
tree9afb8167e9fcfab2daefe9ae048cdf0c70fba3b4
parent02036d90ec10510c8218aad463a332a50c3528c4
net: use a more deterministic approach to get the active ethernet device

If the environment variable "ethact" is not set, the first device in the
uclass is returned. This depends on the probing order of the ethernet
devices. Moreover it is not not configurable at all.

Try to return the ethernet device with sequence id 0 first which then
can be configured by the aliases in a device tree. Fall back to the old
mechanism in case of an error.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
net/eth-uclass.c