summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/wiznet
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2012-08-22 21:28:19 +0000
committerDavid S. Miller <davem@davemloft.net>2012-08-24 13:30:27 -0400
commitd68bb7e1a65f2604156958ae03a556b6a207514b (patch)
tree651788a99d3ac199a4ca468384dd0ecdb5c14f7b /drivers/net/ethernet/wiznet
parent9213bb8325747d00b6d9d5aea6ccde6a72c8a1fa (diff)
downloadlinux-d68bb7e1a65f2604156958ae03a556b6a207514b.tar.bz2
w5100: using eth_hw_addr_random() for random MAC and set device flag
Using eth_hw_addr_random() to generate a random Ethernet address (MAC) to be used by a net device and set addr_assign_type. Not need to duplicating its implementation. spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/wiznet')
-rw-r--r--drivers/net/ethernet/wiznet/w5100.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/wiznet/w5100.c b/drivers/net/ethernet/wiznet/w5100.c
index a5826a3111a6..2c08bf6e7bf3 100644
--- a/drivers/net/ethernet/wiznet/w5100.c
+++ b/drivers/net/ethernet/wiznet/w5100.c
@@ -637,8 +637,7 @@ static int __devinit w5100_hw_probe(struct platform_device *pdev)
if (data && is_valid_ether_addr(data->mac_addr)) {
memcpy(ndev->dev_addr, data->mac_addr, ETH_ALEN);
} else {
- eth_random_addr(ndev->dev_addr);
- ndev->addr_assign_type |= NET_ADDR_RANDOM;
+ eth_hw_addr_random(ndev);
}
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);