[U-Boot] [PATCH v2 1/3] net: eth: Clear MAC address in eth_pre_remove()
Joe Hershberger
joe.hershberger at gmail.com
Fri Sep 11 00:32:53 CEST 2015
Hi Bin,
On Thu, Sep 10, 2015 at 4:29 AM, Bin Meng <bmeng.cn at gmail.com> wrote:
> When removing an Ethernet device, the MAC address saved in the dev's
> platdata should be cleared.
Why is this important to do? Test case?
> Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
>
> ---
>
> Changes in v2:
> - New patch to clear MAC address in eth_pre_remove()
>
> net/eth.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/net/eth.c b/net/eth.c
> index 26520d3..35f9641 100644
> --- a/net/eth.c
> +++ b/net/eth.c
> @@ -564,8 +564,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;
> }
>
> --
> 1.8.2.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
More information about the U-Boot
mailing list