diff options
Diffstat (limited to 'drivers/net/ethernet/natsemi/ns83820.c')
-rw-r--r-- | drivers/net/ethernet/natsemi/ns83820.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/ethernet/natsemi/ns83820.c b/drivers/net/ethernet/natsemi/ns83820.c index 72794d158871..49ea130c9067 100644 --- a/drivers/net/ethernet/natsemi/ns83820.c +++ b/drivers/net/ethernet/natsemi/ns83820.c @@ -1649,9 +1649,11 @@ failed: return ret; } -static void ns83820_getmac(struct ns83820 *dev, u8 *mac) +static void ns83820_getmac(struct ns83820 *dev, struct net_device *ndev) { + u8 mac[ETH_ALEN]; unsigned i; + for (i=0; i<3; i++) { u32 data; @@ -1661,9 +1663,10 @@ static void ns83820_getmac(struct ns83820 *dev, u8 *mac) writel(i*2, dev->base + RFCR); data = readl(dev->base + RFDR); - *mac++ = data; - *mac++ = data >> 8; + mac[i * 2] = data; + mac[i * 2 + 1] = data >> 8; } + eth_hw_addr_set(ndev, mac); } static void ns83820_set_multicast(struct net_device *ndev) @@ -2136,7 +2139,7 @@ static int ns83820_init_one(struct pci_dev *pci_dev, /* Disable Wake On Lan */ writel(0, dev->base + WCSR); - ns83820_getmac(dev, ndev->dev_addr); + ns83820_getmac(dev, ndev); /* Yes, we support dumb IP checksum on transmit */ ndev->features |= NETIF_F_SG; |