w5300: using eth_hw_addr_random() for random MAC and set device flag
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 22 Aug 2012 21:28:40 +0000 (21:28 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 24 Aug 2012 17:30:27 +0000 (13:30 -0400)
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>
drivers/net/ethernet/wiznet/w5300.c

index bdd8891c215ad3c1b4ca4fa6b5ae6ddc3724a7df..88943d90c7653565283a064e3a8ed25f65d5d213 100644 (file)
@@ -557,8 +557,7 @@ static int __devinit w5300_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);