
In fdt_support.c we use a loop to parse the mac address string from the fdt blob, net.h has a function for this however, so lets use it.
Also, rename the variable from tmp to something more descriptive.
Signed-off-by: Olliver Schinagl oliver@schinagl.nl --- common/fdt_support.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/common/fdt_support.c b/common/fdt_support.c index d462bf0642..4d05465232 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -469,8 +469,8 @@ int fdt_fixup_memory(void *blob, u64 start, u64 size)
void fdt_fixup_ethernet(void *fdt) { - int i, j, prop; - char *tmp, *end; + int i, prop; + char *fdt_eth_addr; char mac[ETH_ENETADDR_ENV_NAME_LEN]; const char *path; unsigned char mac_addr[ARP_HLEN]; @@ -509,16 +509,11 @@ void fdt_fixup_ethernet(void *fdt) } else { continue; } - tmp = getenv(mac); - if (!tmp) + fdt_eth_addr = getenv(mac); + if (!fdt_eth_addr) continue;
- for (j = 0; j < 6; j++) { - mac_addr[j] = tmp ? - simple_strtoul(tmp, &end, 16) : 0; - if (tmp) - tmp = (*end) ? end + 1 : end; - } + eth_parse_enetaddr(fdt_eth_addr, mac_addr);
do_fixup_by_path(fdt, path, "mac-address", &mac_addr, 6, 0);