Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[pandora-kernel.git] / drivers / serial / serial_cs.c
index 783b0c5..6b76bab 100644 (file)
@@ -35,7 +35,6 @@
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/sched.h>
 #include <linux/ptrace.h>
 #include <linux/slab.h>
 #include <linux/string.h>
@@ -247,6 +246,10 @@ static const struct serial_quirk quirks[] = {
                .manfid = MANFID_QUATECH,
                .prodid = PRODID_QUATECH_DUAL_RS232_D1,
                .multi  = 2,
+       }, {
+               .manfid = MANFID_QUATECH,
+               .prodid = PRODID_QUATECH_DUAL_RS232_G,
+               .multi  = 2,
        }, {
                .manfid = MANFID_QUATECH,
                .prodid = PRODID_QUATECH_QUAD_RS232,
@@ -334,10 +337,9 @@ static int serial_probe(struct pcmcia_device *link)
        DEBUG(0, "serial_attach()\n");
 
        /* Create new serial device */
-       info = kmalloc(sizeof (*info), GFP_KERNEL);
+       info = kzalloc(sizeof (*info), GFP_KERNEL);
        if (!info)
                return -ENOMEM;
-       memset(info, 0, sizeof (*info));
        info->p_dev = link;
        link->priv = info;
 
@@ -723,7 +725,7 @@ static int serial_config(struct pcmcia_device * link)
        u_char *buf;
        cisparse_t *parse;
        cistpl_cftable_entry_t *cf;
-       int i, last_ret, last_fn;
+       int i;
 
        DEBUG(0, "serial_config(0x%p)\n", link);
 
@@ -740,15 +742,6 @@ static int serial_config(struct pcmcia_device * link)
        tuple->TupleOffset = 0;
        tuple->TupleDataMax = 255;
        tuple->Attributes = 0;
-       /* Get configuration register information */
-       tuple->DesiredTuple = CISTPL_CONFIG;
-       last_ret = first_tuple(link, tuple, parse);
-       if (last_ret != CS_SUCCESS) {
-               last_fn = ParseTuple;
-               goto cs_failed;
-       }
-       link->conf.ConfigBase = parse->config.base;
-       link->conf.Present = parse->config.rmask[0];
 
        /* Is this a compliant multifunction card? */
        tuple->DesiredTuple = CISTPL_LONGLINK_MFC;
@@ -757,27 +750,25 @@ static int serial_config(struct pcmcia_device * link)
 
        /* Is this a multiport card? */
        tuple->DesiredTuple = CISTPL_MANFID;
-       if (first_tuple(link, tuple, parse) == CS_SUCCESS) {
-               info->manfid = parse->manfid.manf;
-               info->prodid = parse->manfid.card;
-
-               for (i = 0; i < ARRAY_SIZE(quirks); i++)
-                       if ((quirks[i].manfid == ~0 ||
-                            quirks[i].manfid == info->manfid) &&
-                           (quirks[i].prodid == ~0 ||
-                            quirks[i].prodid == info->prodid)) {
-                               info->quirk = &quirks[i];
-                               break;
-                       }
-       }
+       info->manfid = link->manf_id;
+       info->prodid = link->card_id;
+
+       for (i = 0; i < ARRAY_SIZE(quirks); i++)
+               if ((quirks[i].manfid == ~0 ||
+                    quirks[i].manfid == info->manfid) &&
+                   (quirks[i].prodid == ~0 ||
+                    quirks[i].prodid == info->prodid)) {
+                       info->quirk = &quirks[i];
+                       break;
+               }
 
        /* Another check for dual-serial cards: look for either serial or
           multifunction cards that ask for appropriate IO port ranges */
        tuple->DesiredTuple = CISTPL_FUNCID;
        if ((info->multi == 0) &&
-           ((first_tuple(link, tuple, parse) != CS_SUCCESS) ||
-            (parse->funcid.func == CISTPL_FUNCID_MULTI) ||
-            (parse->funcid.func == CISTPL_FUNCID_SERIAL))) {
+           (link->has_func_id) &&
+           ((link->func_id == CISTPL_FUNCID_MULTI) ||
+            (link->func_id == CISTPL_FUNCID_SERIAL))) {
                tuple->DesiredTuple = CISTPL_CFTABLE_ENTRY;
                if (first_tuple(link, tuple, parse) == CS_SUCCESS) {
                        if ((cf->io.nwin == 1) && (cf->io.win[0].len % 8 == 0))
@@ -814,8 +805,6 @@ static int serial_config(struct pcmcia_device * link)
        kfree(cfg_mem);
        return 0;
 
- cs_failed:
-       cs_error(link, last_fn, last_ret);
  failed:
        serial_remove(link);
        kfree(cfg_mem);
@@ -906,6 +895,7 @@ static struct pcmcia_device_id serial_ids[] = {
        PCMCIA_DEVICE_PROD_ID12("OEM      ", "C288MX     ", 0xb572d360, 0xd2385b7a),
        PCMCIA_DEVICE_PROD_ID12("PCMCIA   ", "C336MX     ", 0x99bcafe9, 0xaa25bcab),
        PCMCIA_DEVICE_PROD_ID12("Quatech Inc", "PCMCIA Dual RS-232 Serial Port Card", 0xc4420b35, 0x92abc92f),
+       PCMCIA_DEVICE_PROD_ID12("Quatech Inc", "Dual RS-232 Serial Port PC Card", 0xc4420b35, 0x031a380d),
        PCMCIA_PFC_DEVICE_CIS_PROD_ID12(1, "PCMCIA", "EN2218-LAN/MODEM", 0x281f1c5d, 0x570f348e, "PCMLM28.cis"),
        PCMCIA_PFC_DEVICE_CIS_PROD_ID12(1, "PCMCIA", "UE2218-LAN/MODEM", 0x281f1c5d, 0x6fdcacee, "PCMLM28.cis"),
        PCMCIA_PFC_DEVICE_CIS_PROD_ID12(1, "Psion Dacom", "Gold Card V34 Ethernet", 0xf5f025c2, 0x338e8155, "PCMLM28.cis"),