mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 10:39:08 +00:00
net: Always build the string_to_enetaddr() helper
Part of the env cleanup moved this out of the environment code and into the net code. However, this helper is sometimes needed even when the net stack isn't included. Move the helper to lib/net_utils.c like it's similarly-purposed string_to_ip(). Also rename the moved function to similar naming. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reported-by: Ondrej Jirman <megous@megous.com>
This commit is contained in:
parent
b38c3a641f
commit
fb8977c5be
12 changed files with 39 additions and 37 deletions
12
net/net.c
12
net/net.c
|
@ -1625,15 +1625,3 @@ ushort env_get_vlan(char *var)
|
|||
{
|
||||
return string_to_vlan(env_get(var));
|
||||
}
|
||||
|
||||
void eth_parse_enetaddr(const char *addr, uint8_t *enetaddr)
|
||||
{
|
||||
char *end;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 6; ++i) {
|
||||
enetaddr[i] = addr ? simple_strtoul(addr, &end, 16) : 0;
|
||||
if (addr)
|
||||
addr = (*end) ? end + 1 : end;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue