lkml.org 
[lkml]   [2018]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 2/2] net: macb: Try to retrieve MAC addess from nvmem provider
From
Date
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@topic.nl>

For this part:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.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

\
 
 \ /
  Last update: 2018-03-28 10:01    [W:0.121 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site