diff options
Diffstat (limited to 'drivers/net/ethernet/calxeda/xgmac.c')
-rw-r--r-- | drivers/net/ethernet/calxeda/xgmac.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c index b6a066404f4b..457cb7121000 100644 --- a/drivers/net/ethernet/calxeda/xgmac.c +++ b/drivers/net/ethernet/calxeda/xgmac.c @@ -607,7 +607,7 @@ static inline void xgmac_mac_disable(void __iomem *ioaddr) writel(value, ioaddr + XGMAC_CONTROL); } -static void xgmac_set_mac_addr(void __iomem *ioaddr, unsigned char *addr, +static void xgmac_set_mac_addr(void __iomem *ioaddr, const unsigned char *addr, int num) { u32 data; @@ -1479,7 +1479,7 @@ static int xgmac_set_mac_address(struct net_device *dev, void *p) if (!is_valid_ether_addr(addr->sa_data)) return -EADDRNOTAVAIL; - memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); + eth_hw_addr_set(dev, addr->sa_data); xgmac_set_mac_addr(ioaddr, dev->dev_addr, 0); @@ -1693,6 +1693,7 @@ static int xgmac_probe(struct platform_device *pdev) struct resource *res; struct net_device *ndev = NULL; struct xgmac_priv *priv = NULL; + u8 addr[ETH_ALEN]; u32 uid; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -1785,7 +1786,8 @@ static int xgmac_probe(struct platform_device *pdev) ndev->max_mtu = XGMAC_MAX_MTU; /* Get the MAC address */ - xgmac_get_mac_addr(priv->base, ndev->dev_addr, 0); + xgmac_get_mac_addr(priv->base, addr, 0); + eth_hw_addr_set(ndev, addr); if (!is_valid_ether_addr(ndev->dev_addr)) netdev_warn(ndev, "MAC address %pM not valid", ndev->dev_addr); |