pcmcia: do not use io_req_t after call to pcmcia_request_io()
[linux-2.6.git] / drivers / bluetooth / bt3c_cs.c
index d814a27..8ab494c 100644 (file)
@@ -45,7 +45,6 @@
 #include <linux/device.h>
 #include <linux/firmware.h>
 
-#include <pcmcia/cs_types.h>
 #include <pcmcia/cs.h>
 #include <pcmcia/cistpl.h>
 #include <pcmcia/ciscode.h>
@@ -72,7 +71,6 @@ MODULE_FIRMWARE("BT3CPCC.bin");
 
 typedef struct bt3c_info_t {
        struct pcmcia_device *p_dev;
-       dev_node_t node;
 
        struct hci_dev *hdev;
 
@@ -190,7 +188,7 @@ static void bt3c_write_wakeup(bt3c_info_t *info)
                return;
 
        do {
-               register unsigned int iobase = info->p_dev->io.BasePort1;
+               register unsigned int iobase = info->p_dev->resource[0]->start;
                register struct sk_buff *skb;
                register int len;
 
@@ -228,7 +226,7 @@ static void bt3c_receive(bt3c_info_t *info)
                return;
        }
 
-       iobase = info->p_dev->io.BasePort1;
+       iobase = info->p_dev->resource[0]->start;
 
        avail = bt3c_read(iobase, 0x7006);
        //printk("bt3c_cs: receiving %d bytes\n", avail);
@@ -345,9 +343,11 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst)
        int iir;
        irqreturn_t r = IRQ_NONE;
 
-       BUG_ON(!info->hdev);
+       if (!info || !info->hdev)
+               /* our irq handler is shared */
+               return IRQ_NONE;
 
-       iobase = info->p_dev->io.BasePort1;
+       iobase = info->p_dev->resource[0]->start;
 
        spin_lock(&(info->lock));
 
@@ -480,7 +480,7 @@ static int bt3c_load_firmware(bt3c_info_t *info, const unsigned char *firmware,
        unsigned int iobase, size, addr, fcs, tmp;
        int i, err = 0;
 
-       iobase = info->p_dev->io.BasePort1;
+       iobase = info->p_dev->resource[0]->start;
 
        /* Reset */
        bt3c_io_write(iobase, 0x8040, 0x0404);
@@ -580,7 +580,7 @@ static int bt3c_open(bt3c_info_t *info)
 
        info->hdev = hdev;
 
-       hdev->type = HCI_PCCARD;
+       hdev->bus = HCI_PCCARD;
        hdev->driver_data = info;
        SET_HCIDEV_DEV(hdev, &info->p_dev->dev);
 
@@ -659,9 +659,6 @@ static int bt3c_probe(struct pcmcia_device *link)
 
        link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
        link->io.NumPorts1 = 8;
-       link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-
-       link->irq.Handler = bt3c_interrupt;
 
        link->conf.Attributes = CONF_ENABLE_IRQ;
        link->conf.IntType = INT_MEMORY_AND_IO;
@@ -741,9 +738,9 @@ static int bt3c_config(struct pcmcia_device *link)
        goto failed;
 
 found_port:
-       i = pcmcia_request_irq(link, &link->irq);
+       i = pcmcia_request_irq(link, &bt3c_interrupt);
        if (i != 0)
-               link->irq.AssignedIRQ = 0;
+               goto failed;
 
        i = pcmcia_request_configuration(link, &link->conf);
        if (i != 0)
@@ -752,9 +749,6 @@ found_port:
        if (bt3c_open(info) != 0)
                goto failed;
 
-       strcpy(info->node.dev_name, info->hdev->name);
-       link->dev_node = &info->node;
-
        return 0;
 
 failed: