pcmcia: re-work pcmcia_request_irq()
[pandora-kernel.git] / drivers / staging / comedi / drivers / ni_daq_dio24.c
index ddc312b..2259fb4 100644 (file)
@@ -131,7 +131,7 @@ static int dio24_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                        return -EIO;
                iobase = link->io.BasePort1;
 #ifdef incomplete
-               irq = link->irq.AssignedIRQ;
+               irq = link->irq;
 #endif
                break;
        default:
@@ -253,10 +253,6 @@ static int dio24_cs_attach(struct pcmcia_device *link)
        local->link = link;
        link->priv = local;
 
-       /* Interrupt setup */
-       link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-       link->irq.Handler = NULL;
-
        /*
           General socket configuration defaults can go here.  In this
           client, we assume very little, and rely on the CIS for almost
@@ -328,8 +324,7 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev,
        }
 
        /* Do we need to allocate an interrupt? */
-       if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
-               p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+       p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
        /* IO window settings */
        p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
@@ -390,16 +385,8 @@ static void dio24_config(struct pcmcia_device *link)
                goto failed;
        }
 
-       /*
-          Allocate an interrupt line.  Note that this does not assign a
-          handler to the interrupt, unless the 'Handler' member of the
-          irq structure is initialized.
-        */
-       if (link->conf.Attributes & CONF_ENABLE_IRQ) {
-               ret = pcmcia_request_irq(link, &link->irq);
-               if (ret)
-                       goto failed;
-       }
+       if (!link->irq)
+               goto failed;
 
        /*
           This actually configures the PCMCIA socket -- setting up
@@ -422,7 +409,7 @@ static void dio24_config(struct pcmcia_device *link)
        printk(KERN_INFO "%s: index 0x%02x",
               dev->node.dev_name, link->conf.ConfigIndex);
        if (link->conf.Attributes & CONF_ENABLE_IRQ)
-               printk(", irq %d", link->irq.AssignedIRQ);
+               printk(", irq %d", link->irq);
        if (link->io.NumPorts1)
                printk(", io 0x%04x-0x%04x", link->io.BasePort1,
                       link->io.BasePort1 + link->io.NumPorts1 - 1);