3com/typhoon: reuse eth_mac_addr()
authorDanny Kukawka <danny.kukawka@bisect.de>
Wed, 22 Feb 2012 02:36:38 +0000 (02:36 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Feb 2012 19:46:37 +0000 (14:46 -0500)
Use eth_mac_addr() for .ndo_set_mac_address, remove
typhoon_set_mac_address() since it do currently the same as
eth_mac_addr(). Additional advantage: eth_mac_addr() already
checks if the given address is valid.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Acked-by: Dave Dillow <dave@thedillows.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/3com/typhoon.c

index f7d622eed203e69efb922ad70e599e8001db6140..1234a14b2b73b0bc2a0e478c6910c0b45dcfab07 100644 (file)
@@ -966,18 +966,6 @@ typhoon_get_stats(struct net_device *dev)
        return stats;
 }
 
-static int
-typhoon_set_mac_address(struct net_device *dev, void *addr)
-{
-       struct sockaddr *saddr = (struct sockaddr *) addr;
-
-       if(netif_running(dev))
-               return -EBUSY;
-
-       memcpy(dev->dev_addr, saddr->sa_data, dev->addr_len);
-       return 0;
-}
-
 static void
 typhoon_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
 {
@@ -2266,7 +2254,7 @@ static const struct net_device_ops typhoon_netdev_ops = {
        .ndo_tx_timeout         = typhoon_tx_timeout,
        .ndo_get_stats          = typhoon_get_stats,
        .ndo_validate_addr      = eth_validate_addr,
-       .ndo_set_mac_address    = typhoon_set_mac_address,
+       .ndo_set_mac_address    = eth_mac_addr,
        .ndo_change_mtu         = eth_change_mtu,
 };