Commit ff021f22 authored by Maxim Kochetkov's avatar Maxim Kochetkov Committed by David S. Miller

gianfar: Use random MAC address when none is given

If there is no valid MAC address in the device tree,
use a random MAC address.
Signed-off-by: default avatarMaxim Kochetkov <fido_max@inbox.ru>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3195c470
...@@ -779,8 +779,12 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev) ...@@ -779,8 +779,12 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev)
mac_addr = of_get_mac_address(np); mac_addr = of_get_mac_address(np);
if (!IS_ERR(mac_addr)) if (!IS_ERR(mac_addr)) {
ether_addr_copy(dev->dev_addr, mac_addr); ether_addr_copy(dev->dev_addr, mac_addr);
} else {
eth_hw_addr_random(dev);
dev_info(&ofdev->dev, "Using random MAC address: %pM\n", dev->dev_addr);
}
if (model && !strcasecmp(model, "TSEC")) if (model && !strcasecmp(model, "TSEC"))
priv->device_flags |= FSL_GIANFAR_DEV_HAS_GIGABIT | priv->device_flags |= FSL_GIANFAR_DEV_HAS_GIGABIT |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment