From: Ben Dooks Date: Thu, 24 Feb 2011 03:17:12 +0000 (+0000) Subject: DM9000: Allow randomised ethernet address X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=85e6b8c5d8be1e901b5402bfe42ce408912ab83e;p=linux-beck.git DM9000: Allow randomised ethernet address Allow randomised ethernet address if the device does not have a valid EEPROM or pre-set MAC address. Signed-off-by: Ben Dooks Signed-off-by: Mark Brown Signed-off-by: David S. Miller --- diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index 2d4c4fc1d900..c30935587207 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c @@ -1592,10 +1592,15 @@ dm9000_probe(struct platform_device *pdev) ndev->dev_addr[i] = ior(db, i+DM9000_PAR); } - if (!is_valid_ether_addr(ndev->dev_addr)) + if (!is_valid_ether_addr(ndev->dev_addr)) { dev_warn(db->dev, "%s: Invalid ethernet MAC address. Please " "set using ifconfig\n", ndev->name); + random_ether_addr(ndev->dev_addr); + mac_src = "random"; + } + + platform_set_drvdata(pdev, ndev); ret = register_netdev(ndev);