Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[pandora-kernel.git] / drivers / isdn / hisax / avma1_cs.c
index 8d1d63a..a80a761 100644 (file)
@@ -62,31 +62,6 @@ static void avma1cs_release(struct pcmcia_device *link);
 static void avma1cs_detach(struct pcmcia_device *p_dev) __devexit ;
 
 
-/*
-   A linked list of "instances" of the skeleton device.  Each actual
-   PCMCIA card corresponds to one device instance, and is described
-   by one struct pcmcia_device structure (defined in ds.h).
-
-   You may not want to use a linked list for this -- for example, the
-   memory card driver uses an array of struct pcmcia_device pointers, where minor
-   device numbers are used to derive the corresponding array index.
-*/
-
-/*
-   A driver needs to provide a dev_node_t structure for each device
-   on a card.  In some cases, there is only one device per card (for
-   example, ethernet cards, modems).  In other cases, there may be
-   many actual or logical devices (SCSI adapters, memory cards with
-   multiple partitions).  The dev_node_t structures need to be kept
-   in a linked list starting at the 'dev' field of a struct pcmcia_device
-   structure.  We allocate them in the card's private data structure,
-   because they generally can't be allocated dynamically.
-*/
-   
-typedef struct local_info_t {
-    dev_node_t node;
-} local_info_t;
-
 /*======================================================================
 
     avma1cs_attach() creates an "instance" of the driver, allocating
@@ -101,17 +76,8 @@ typedef struct local_info_t {
 
 static int __devinit avma1cs_probe(struct pcmcia_device *p_dev)
 {
-    local_info_t *local;
-
     dev_dbg(&p_dev->dev, "avma1cs_attach()\n");
 
-    /* Allocate space for private device-specific data */
-    local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
-    if (!local)
-       return -ENOMEM;
-
-    p_dev->priv = local;
-
     /* The io structure describes IO port mapping */
     p_dev->io.NumPorts1 = 16;
     p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
@@ -119,9 +85,6 @@ static int __devinit avma1cs_probe(struct pcmcia_device *p_dev)
     p_dev->io.Attributes2 = IO_DATA_PATH_WIDTH_16;
     p_dev->io.IOAddrLines = 5;
 
-    /* Interrupt setup */
-    p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-
     /* General socket configuration */
     p_dev->conf.Attributes = CONF_ENABLE_IRQ;
     p_dev->conf.IntType = INT_MEMORY_AND_IO;
@@ -176,14 +139,11 @@ static int avma1cs_configcheck(struct pcmcia_device *p_dev,
 
 static int __devinit avma1cs_config(struct pcmcia_device *link)
 {
-    local_info_t *dev;
-    int i;
+    int i = -1;
     char devname[128];
     IsdnCard_t icard;
     int busy = 0;
 
-    dev = link->priv;
-
     dev_dbg(&link->dev, "avma1cs_config(0x%p)\n", link);
 
     devname[0] = 0;
@@ -197,8 +157,7 @@ static int __devinit avma1cs_config(struct pcmcia_device *link)
        /*
         * allocate an interrupt line
         */
-       i = pcmcia_request_irq(link, &link->irq);
-       if (i != 0) {
+       if (!link->irq) {
            /* undo */
            pcmcia_disable_device(link);
            break;
@@ -215,14 +174,6 @@ static int __devinit avma1cs_config(struct pcmcia_device *link)
 
     } while (0);
 
-    /* At this point, the dev_node_t structure(s) should be
-       initialized and arranged in a linked list at link->dev. */
-
-    strcpy(dev->node.dev_name, "A1");
-    dev->node.major = 45;
-    dev->node.minor = 0;
-    link->dev_node = &dev->node;
-
     /* If any step failed, release any partially configured state */
     if (i != 0) {
        avma1cs_release(link);
@@ -230,9 +181,9 @@ static int __devinit avma1cs_config(struct pcmcia_device *link)
     }
 
     printk(KERN_NOTICE "avma1_cs: checking at i/o %#x, irq %d\n",
-                               link->io.BasePort1, link->irq.AssignedIRQ);
+                               link->io.BasePort1, link->irq);
 
-    icard.para[0] = link->irq.AssignedIRQ;
+    icard.para[0] = link->irq;
     icard.para[1] = link->io.BasePort1;
     icard.protocol = isdnprot;
     icard.typ = ISDN_CTYPE_A1_PCMCIA;
@@ -243,7 +194,7 @@ static int __devinit avma1cs_config(struct pcmcia_device *link)
        avma1cs_release(link);
        return -ENODEV;
     }
-    dev->node.minor = i;
+    link->priv = (void *) (unsigned long) i;
 
     return 0;
 } /* avma1cs_config */
@@ -258,12 +209,12 @@ static int __devinit avma1cs_config(struct pcmcia_device *link)
 
 static void avma1cs_release(struct pcmcia_device *link)
 {
-       local_info_t *local = link->priv;
+       unsigned long minor = (unsigned long) link->priv;
 
        dev_dbg(&link->dev, "avma1cs_release(0x%p)\n", link);
 
        /* now unregister function with hisax */
-       HiSax_closecard(local->node.minor);
+       HiSax_closecard(minor);
 
        pcmcia_disable_device(link);
 } /* avma1cs_release */