diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-10-18 17:54:24 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-11-08 12:23:05 -0500 |
commit | dddfbd824b96a25da0b2f1cf35c0be33ef2422fe (patch) | |
tree | 0f48f2883bd00ec5f15d8d32a3c826a3184f47ba /drivers/net/pcmcia/3c574_cs.c | |
parent | 91284224da5b15ec6c2b45e10fa5eccd1c92a204 (diff) |
pcmcia: convert net pcmcia drivers to use new CIS helpers
Use the new CIS helpers in net pcmcia drivers, which allows for
a few code cleanups.
This revision does not remove the phys_addr assignment in
3c589_cs.c -- a bug noted by Komuro <komurojun-mbn@nifty.com>
CC: David S. Miller <davem@davemloft.net>
CC: netdev@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/pcmcia/3c574_cs.c')
-rw-r--r-- | drivers/net/pcmcia/3c574_cs.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index b58965a2b3ae..6449290c62ff 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c | |||
@@ -344,13 +344,13 @@ static int tc574_config(struct pcmcia_device *link) | |||
344 | { | 344 | { |
345 | struct net_device *dev = link->priv; | 345 | struct net_device *dev = link->priv; |
346 | struct el3_private *lp = netdev_priv(dev); | 346 | struct el3_private *lp = netdev_priv(dev); |
347 | tuple_t tuple; | ||
348 | __le16 buf[32]; | ||
349 | int last_fn, last_ret, i, j; | 347 | int last_fn, last_ret, i, j; |
350 | unsigned int ioaddr; | 348 | unsigned int ioaddr; |
351 | __be16 *phys_addr; | 349 | __be16 *phys_addr; |
352 | char *cardname; | 350 | char *cardname; |
353 | __u32 config; | 351 | __u32 config; |
352 | u8 *buf; | ||
353 | size_t len; | ||
354 | 354 | ||
355 | phys_addr = (__be16 *)dev->dev_addr; | 355 | phys_addr = (__be16 *)dev->dev_addr; |
356 | 356 | ||
@@ -378,16 +378,14 @@ static int tc574_config(struct pcmcia_device *link) | |||
378 | /* The 3c574 normally uses an EEPROM for configuration info, including | 378 | /* The 3c574 normally uses an EEPROM for configuration info, including |
379 | the hardware address. The future products may include a modem chip | 379 | the hardware address. The future products may include a modem chip |
380 | and put the address in the CIS. */ | 380 | and put the address in the CIS. */ |
381 | tuple.Attributes = 0; | 381 | |
382 | tuple.TupleData = (cisdata_t *)buf; | 382 | len = pcmcia_get_tuple(link, 0x88, &buf); |
383 | tuple.TupleDataMax = 64; | 383 | if (buf && len >= 6) { |
384 | tuple.TupleOffset = 0; | ||
385 | tuple.DesiredTuple = 0x88; | ||
386 | if (pcmcia_get_first_tuple(link, &tuple) == 0) { | ||
387 | pcmcia_get_tuple_data(link, &tuple); | ||
388 | for (i = 0; i < 3; i++) | 384 | for (i = 0; i < 3; i++) |
389 | phys_addr[i] = htons(le16_to_cpu(buf[i])); | 385 | phys_addr[i] = htons(le16_to_cpu(buf[i * 2])); |
386 | kfree(buf); | ||
390 | } else { | 387 | } else { |
388 | kfree(buf); /* 0 < len < 6 */ | ||
391 | EL3WINDOW(0); | 389 | EL3WINDOW(0); |
392 | for (i = 0; i < 3; i++) | 390 | for (i = 0; i < 3; i++) |
393 | phys_addr[i] = htons(read_eeprom(ioaddr, i + 10)); | 391 | phys_addr[i] = htons(read_eeprom(ioaddr, i + 10)); |