]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/bluetooth/btuart_cs.c
Merge git://git.infradead.org/mtd-2.6
[linux-2.6-omap-h63xx.git] / drivers / bluetooth / btuart_cs.c
index 5e31ea2f2d6f37d88d60ae84176020f1eabc7ea2..efd689a062eb231dcd95c58af780822d0f00c479 100644 (file)
@@ -293,6 +293,7 @@ static irqreturn_t btuart_interrupt(int irq, void *dev_inst)
        unsigned int iobase;
        int boguscount = 0;
        int iir, lsr;
+       irqreturn_t r = IRQ_NONE;
 
        BUG_ON(!info->hdev);
 
@@ -302,6 +303,7 @@ static irqreturn_t btuart_interrupt(int irq, void *dev_inst)
 
        iir = inb(iobase + UART_IIR) & UART_IIR_ID;
        while (iir) {
+               r = IRQ_HANDLED;
 
                /* Clear interrupt */
                lsr = inb(iobase + UART_LSR);
@@ -335,7 +337,7 @@ static irqreturn_t btuart_interrupt(int irq, void *dev_inst)
 
        spin_unlock(&(info->lock));
 
-       return IRQ_HANDLED;
+       return r;
 }
 
 
@@ -586,7 +588,7 @@ static int btuart_probe(struct pcmcia_device *link)
 
        link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
        link->io.NumPorts1 = 8;
-       link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
+       link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT;
        link->irq.IRQInfo1 = IRQ_LEVEL_ID;
 
        link->irq.Handler = btuart_interrupt;
@@ -609,16 +611,18 @@ static void btuart_detach(struct pcmcia_device *link)
 
 static int btuart_check_config(struct pcmcia_device *p_dev,
                               cistpl_cftable_entry_t *cf,
+                              cistpl_cftable_entry_t *dflt,
+                              unsigned int vcc,
                               void *priv_data)
 {
-       unsigned long try = (unsigned long) priv_data;
+       int *try = priv_data;
 
        if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
                p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
        if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
            (cf->io.win[0].base != 0)) {
                p_dev->io.BasePort1 = cf->io.win[0].base;
-               p_dev->io.IOAddrLines = (try == 0) ? 16 :
+               p_dev->io.IOAddrLines = (*try == 0) ? 16 :
                        cf->io.flags & CISTPL_IO_LINES_MASK;
                if (!pcmcia_request_io(p_dev, &p_dev->io))
                        return 0;
@@ -628,6 +632,8 @@ static int btuart_check_config(struct pcmcia_device *p_dev,
 
 static int btuart_check_config_notpicky(struct pcmcia_device *p_dev,
                                        cistpl_cftable_entry_t *cf,
+                                       cistpl_cftable_entry_t *dflt,
+                                       unsigned int vcc,
                                        void *priv_data)
 {
        static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
@@ -648,13 +654,12 @@ static int btuart_config(struct pcmcia_device *link)
 {
        btuart_info_t *info = link->priv;
        int i;
-       unsigned long try;
+       int try;
 
        /* First pass: look for a config entry that looks normal.
           Two tries: without IO aliases, then with aliases */
        for (try = 0; try < 2; try++)
-               if (!pcmcia_loop_config(link, btuart_check_config,
-                                       (void *) try))
+               if (!pcmcia_loop_config(link, btuart_check_config, &try))
                        goto found_port;
 
        /* Second pass: try to find an entry that isn't picky about
@@ -669,13 +674,13 @@ static int btuart_config(struct pcmcia_device *link)
 
 found_port:
        i = pcmcia_request_irq(link, &link->irq);
-       if (i != CS_SUCCESS) {
+       if (i != 0) {
                cs_error(link, RequestIRQ, i);
                link->irq.AssignedIRQ = 0;
        }
 
        i = pcmcia_request_configuration(link, &link->conf);
-       if (i != CS_SUCCESS) {
+       if (i != 0) {
                cs_error(link, RequestConfiguration, i);
                goto failed;
        }