diff options
Diffstat (limited to 'drivers/net/ethernet/smsc/smc91c92_cs.c')
-rw-r--r-- | drivers/net/ethernet/smsc/smc91c92_cs.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/ethernet/smsc/smc91c92_cs.c b/drivers/net/ethernet/smsc/smc91c92_cs.c index 42fc37c7887a..37c822e27207 100644 --- a/drivers/net/ethernet/smsc/smc91c92_cs.c +++ b/drivers/net/ethernet/smsc/smc91c92_cs.c @@ -347,6 +347,7 @@ static void smc91c92_detach(struct pcmcia_device *link) static int cvt_ascii_address(struct net_device *dev, char *s) { + u8 mac[ETH_ALEN]; int i, j, da, c; if (strlen(s) != 12) @@ -359,8 +360,9 @@ static int cvt_ascii_address(struct net_device *dev, char *s) da += ((c >= '0') && (c <= '9')) ? (c - '0') : ((c & 0x0f) + 9); } - dev->dev_addr[i] = da; + mac[i] = da; } + eth_hw_addr_set(dev, mac); return 0; } @@ -539,6 +541,7 @@ static int mot_setup(struct pcmcia_device *link) struct net_device *dev = link->priv; unsigned int ioaddr = dev->base_addr; int i, wait, loop; + u8 mac[ETH_ALEN]; u_int addr; /* Read Ethernet address from Serial EEPROM */ @@ -559,9 +562,10 @@ static int mot_setup(struct pcmcia_device *link) return -1; addr = inw(ioaddr + GENERAL); - dev->dev_addr[2*i] = addr & 0xff; - dev->dev_addr[2*i+1] = (addr >> 8) & 0xff; + mac[2*i] = addr & 0xff; + mac[2*i+1] = (addr >> 8) & 0xff; } + eth_hw_addr_set(dev, mac); return 0; } @@ -666,14 +670,13 @@ static int pcmcia_osi_mac(struct pcmcia_device *p_dev, void *priv) { struct net_device *dev = priv; - int i; if (tuple->TupleDataLen < 8) return -EINVAL; if (tuple->TupleData[0] != 0x04) return -EINVAL; - for (i = 0; i < 6; i++) - dev->dev_addr[i] = tuple->TupleData[i+2]; + + eth_hw_addr_set(dev, &tuple->TupleData[2]); return 0; }; |