net: Provide a function to get the current MAC address
The current implementation exposes the eth_device struct to code that
needs to access the MAC address. Add a wrapper function for this to
abstract away the pointer for this operation.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/net/net.c b/net/net.c
index b60ce62..4b3c90e 100644
--- a/net/net.c
+++ b/net/net.c
@@ -275,7 +275,7 @@
env_changed_id = env_id;
}
if (eth_get_dev())
- memcpy(NetOurEther, eth_get_dev()->enetaddr, 6);
+ memcpy(NetOurEther, eth_get_ethaddr(), 6);
return;
}