“d4dabe3e0bc3db35f8599aed5351a4c308014f1a”上不存在“...fluid/operators/git@gitcode.net:paddlepaddle/Paddle.git”
提交 aa076e3d 编写于 作者: M Mike Looijmans 提交者: David S. Miller

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: NMike Looijmans <mike.looijmans@topic.nl>
Acked-by: NNicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 9217e566
......@@ -3952,10 +3952,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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册