diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2013-04-29 05:49:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-04-30 15:37:08 -0400 |
commit | ff6e722870ddca2808b5d46159e58904f8ededf1 (patch) | |
tree | e773cb5bd9f82ce804d26dfb4bdfb79793034aa4 /drivers | |
parent | 3b54912f9cd167641b91d4a697bd742f70e534fe (diff) |
sh_eth: use random MAC address if no valid one supplied
On Renesas R-Car based development boards, although a MAC address is printed on
all the Ethernet port labels, U-Boot doesn't write a valid MAC address to the
Ether MAHR/MALR registers (there's no storage provided for the Ether MAC address
either), so we have to resort to using a random MAC address...
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/renesas/sh_eth.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index e46da1e8f98e..33dc6f2418f2 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c | |||
@@ -2735,6 +2735,11 @@ static int sh_eth_drv_probe(struct platform_device *pdev) | |||
2735 | 2735 | ||
2736 | /* read and set MAC address */ | 2736 | /* read and set MAC address */ |
2737 | read_mac_address(ndev, pd->mac_addr); | 2737 | read_mac_address(ndev, pd->mac_addr); |
2738 | if (!is_valid_ether_addr(ndev->dev_addr)) { | ||
2739 | dev_warn(&pdev->dev, | ||
2740 | "no valid MAC address supplied, using a random one.\n"); | ||
2741 | eth_hw_addr_random(ndev); | ||
2742 | } | ||
2738 | 2743 | ||
2739 | /* ioremap the TSU registers */ | 2744 | /* ioremap the TSU registers */ |
2740 | if (mdp->cd->tsu) { | 2745 | if (mdp->cd->tsu) { |