mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 13:22:23 +00:00
net/nxp/lpc_eth: Drop ifdef CONFIG_OF_NET
Since of_get_mac_address() is now declared even if CONFIG_OF_NET is not configured, the ifdef is no longer necessary and can be removed. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
6c5f7808ef
commit
be0e2f1f7d
@ -1432,13 +1432,11 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
|
|||||||
/* Get MAC address from current HW setting (POR state is all zeros) */
|
/* Get MAC address from current HW setting (POR state is all zeros) */
|
||||||
__lpc_get_mac(pldat, ndev->dev_addr);
|
__lpc_get_mac(pldat, ndev->dev_addr);
|
||||||
|
|
||||||
#ifdef CONFIG_OF_NET
|
|
||||||
if (!is_valid_ether_addr(ndev->dev_addr)) {
|
if (!is_valid_ether_addr(ndev->dev_addr)) {
|
||||||
const char *macaddr = of_get_mac_address(pdev->dev.of_node);
|
const char *macaddr = of_get_mac_address(pdev->dev.of_node);
|
||||||
if (macaddr)
|
if (macaddr)
|
||||||
memcpy(ndev->dev_addr, macaddr, ETH_ALEN);
|
memcpy(ndev->dev_addr, macaddr, ETH_ALEN);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (!is_valid_ether_addr(ndev->dev_addr))
|
if (!is_valid_ether_addr(ndev->dev_addr))
|
||||||
eth_hw_addr_random(ndev);
|
eth_hw_addr_random(ndev);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user