aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/nmclan_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2009-10-18 17:54:24 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2009-11-08 12:23:05 -0500
commitdddfbd824b96a25da0b2f1cf35c0be33ef2422fe (patch)
tree0f48f2883bd00ec5f15d8d32a3c826a3184f47ba /drivers/net/pcmcia/nmclan_cs.c
parent91284224da5b15ec6c2b45e10fa5eccd1c92a204 (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/nmclan_cs.c')
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index 5ed6339c52bc..4b96b356d979 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -661,8 +661,8 @@ static int nmclan_config(struct pcmcia_device *link)
661{ 661{
662 struct net_device *dev = link->priv; 662 struct net_device *dev = link->priv;
663 mace_private *lp = netdev_priv(dev); 663 mace_private *lp = netdev_priv(dev);
664 tuple_t tuple; 664 u8 *buf;
665 u_char buf[64]; 665 size_t len;
666 int i, last_ret, last_fn; 666 int i, last_ret, last_fn;
667 unsigned int ioaddr; 667 unsigned int ioaddr;
668 668
@@ -677,14 +677,13 @@ static int nmclan_config(struct pcmcia_device *link)
677 ioaddr = dev->base_addr; 677 ioaddr = dev->base_addr;
678 678
679 /* Read the ethernet address from the CIS. */ 679 /* Read the ethernet address from the CIS. */
680 tuple.DesiredTuple = 0x80 /* CISTPL_CFTABLE_ENTRY_MISC */; 680 len = pcmcia_get_tuple(link, 0x80, &buf);
681 tuple.TupleData = buf; 681 if (!buf || len < ETHER_ADDR_LEN) {
682 tuple.TupleDataMax = 64; 682 kfree(buf);
683 tuple.TupleOffset = 0; 683 goto failed;
684 tuple.Attributes = 0; 684 }
685 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 685 memcpy(dev->dev_addr, buf, ETHER_ADDR_LEN);
686 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 686 kfree(buf);
687 memcpy(dev->dev_addr, tuple.TupleData, ETHER_ADDR_LEN);
688 687
689 /* Verify configuration by reading the MACE ID. */ 688 /* Verify configuration by reading the MACE ID. */
690 { 689 {