mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
net: eth: Clear MAC address in eth_pre_remove()
platdata->enetaddr was assigned to a value in dev_probe() last time. If we don't clear it, for dev_probe() at the second time, dm eth will end up treating it as a MAC address from ROM no matter where it came from originally (maybe env, ROM, or even random). Fix this by clearing platdata->enetaddr when removing an Ethernet device. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
50dae85c71
commit
a16edabe7f
1 changed files with 5 additions and 0 deletions
|
|
@ -575,8 +575,13 @@ static int eth_post_probe(struct udevice *dev)
|
|||
|
||||
static int eth_pre_remove(struct udevice *dev)
|
||||
{
|
||||
struct eth_pdata *pdata = dev->platdata;
|
||||
|
||||
eth_get_ops(dev)->stop(dev);
|
||||
|
||||
/* clear the MAC address */
|
||||
memset(pdata->enetaddr, 0, 6);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue