lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d7187b2b-a6df-dfba-64ac-f1770c540159@microchip.com>
Date:   Wed, 28 Mar 2018 10:00:46 +0200
From:   Nicolas Ferre <nicolas.ferre@...rochip.com>
To:     Mike Looijmans <mike.looijmans@...ic.nl>, <netdev@...r.kernel.org>
CC:     <linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>,
        <andrew@...n.ch>, <f.fainelli@...il.com>, <robh+dt@...nel.org>,
        <frowand.list@...il.com>
Subject: Re: [PATCH v3 2/2] net: macb: Try to retrieve MAC addess from nvmem
 provider

On 27/03/2018 at 11:52, Mike Looijmans wrote:
> Call of_get_nvmem_mac_address() to fetch the MAC address from an nvmem
> cell, if one is provided in the device tree. This allows the address to
> be stored in an I2C EEPROM device for example.
> 
> Signed-off-by: Mike Looijmans <mike.looijmans@...ic.nl>

For this part:
Acked-by: Nicolas Ferre <nicolas.ferre@...rochip.com>

> ---
>   drivers/net/ethernet/cadence/macb_main.c | 12 +++++++++---
>   1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index e84afcf..eabe14f 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -3950,10 +3950,16 @@ static int macb_probe(struct platform_device *pdev)
>   		dev->max_mtu = ETH_DATA_LEN;
>   
>   	mac = of_get_mac_address(np);
> -	if (mac)
> +	if (mac) {
>   		ether_addr_copy(bp->dev->dev_addr, mac);
> -	else
> -		macb_get_hwaddr(bp);
> +	} else {
> +		err = of_get_nvmem_mac_address(np, bp->dev->dev_addr);
> +		if (err) {
> +			if (err == -EPROBE_DEFER)
> +				goto err_out_free_netdev;
> +			macb_get_hwaddr(bp);
> +		}
> +	}
>   
>   	err = of_get_phy_mode(np);
>   	if (err < 0) {
> 


-- 
Nicolas Ferre

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ