Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa076e3d authored by Mike Looijmans's avatar Mike Looijmans Committed by David S. Miller
Browse files

net: macb: Try to retrieve MAC addess from nvmem provider



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: default avatarMike Looijmans <mike.looijmans@topic.nl>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9217e566
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -3952,10 +3952,16 @@ static int macb_probe(struct platform_device *pdev)
		dev->max_mtu = ETH_DATA_LEN;
		dev->max_mtu = ETH_DATA_LEN;


	mac = of_get_mac_address(np);
	mac = of_get_mac_address(np);
	if (mac)
	if (mac) {
		ether_addr_copy(bp->dev->dev_addr, mac);
		ether_addr_copy(bp->dev->dev_addr, mac);
	else
	} 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);
			macb_get_hwaddr(bp);
		}
	}


	err = of_get_phy_mode(np);
	err = of_get_phy_mode(np);
	if (err < 0) {
	if (err < 0) {