net: make eth_register_ethaddr work on registered network devices
When eth_register_ethaddr is called after the device has been registered it should work aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
8d95a37cae
commit
111a6aa4a9
|
@ -88,9 +88,17 @@ static void eth_drop_ethaddr(int ethid)
|
|||
void eth_register_ethaddr(int ethid, const char *ethaddr)
|
||||
{
|
||||
struct eth_ethaddr *addr;
|
||||
struct eth_device *edev;
|
||||
|
||||
eth_drop_ethaddr(ethid);
|
||||
|
||||
list_for_each_entry(edev, &netdev_list, list) {
|
||||
if (edev->dev.id == ethid) {
|
||||
register_preset_mac_address(edev, ethaddr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
addr = xzalloc(sizeof(*addr));
|
||||
addr->ethid = ethid;
|
||||
memcpy(addr->ethaddr, ethaddr, 6);
|
||||
|
|
Loading…
Reference in New Issue