drivers: ethernet: Verify returned value from net_if_set_link_addr
This commit verifies if the mac configuration is done correctly during liteeth setup, and prompts a warning when not. Signed-off-by: Pawel Sagan <psagan@antmicro.com> Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
This commit is contained in:
parent
4324356a6e
commit
0ce0f63036
|
@ -218,8 +218,11 @@ static void eth_iface_init(struct net_if *iface)
|
|||
#endif
|
||||
|
||||
/* set MAC address */
|
||||
net_if_set_link_addr(iface, context->mac_addr, sizeof(context->mac_addr),
|
||||
NET_LINK_ETHERNET);
|
||||
if (net_if_set_link_addr(iface, context->mac_addr, sizeof(context->mac_addr),
|
||||
NET_LINK_ETHERNET) < 0) {
|
||||
LOG_ERR("setting mac failed");
|
||||
return;
|
||||
}
|
||||
|
||||
/* clear pending events */
|
||||
sys_write8(LITEETH_EV_TX, LITEETH_TX_EV_PENDING);
|
||||
|
|
Loading…
Reference in a new issue