diff options
Diffstat (limited to 'drivers/bluetooth/bt3c_cs.c')
| -rw-r--r-- | drivers/bluetooth/bt3c_cs.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c index 0b848050b0cc..9192a754ebc0 100644 --- a/drivers/bluetooth/bt3c_cs.c +++ b/drivers/bluetooth/bt3c_cs.c | |||
| @@ -72,7 +72,7 @@ MODULE_LICENSE("GPL"); | |||
| 72 | 72 | ||
| 73 | 73 | ||
| 74 | typedef struct bt3c_info_t { | 74 | typedef struct bt3c_info_t { |
| 75 | dev_link_t link; | 75 | struct pcmcia_device *p_dev; |
| 76 | dev_node_t node; | 76 | dev_node_t node; |
| 77 | 77 | ||
| 78 | struct hci_dev *hdev; | 78 | struct hci_dev *hdev; |
| @@ -191,11 +191,11 @@ static void bt3c_write_wakeup(bt3c_info_t *info) | |||
| 191 | return; | 191 | return; |
| 192 | 192 | ||
| 193 | do { | 193 | do { |
| 194 | register unsigned int iobase = info->link.io.BasePort1; | 194 | register unsigned int iobase = info->p_dev->io.BasePort1; |
| 195 | register struct sk_buff *skb; | 195 | register struct sk_buff *skb; |
| 196 | register int len; | 196 | register int len; |
| 197 | 197 | ||
| 198 | if (!(info->link.state & DEV_PRESENT)) | 198 | if (!(info->p_dev->state & DEV_PRESENT)) |
| 199 | break; | 199 | break; |
| 200 | 200 | ||
| 201 | 201 | ||
| @@ -229,7 +229,7 @@ static void bt3c_receive(bt3c_info_t *info) | |||
| 229 | return; | 229 | return; |
| 230 | } | 230 | } |
| 231 | 231 | ||
| 232 | iobase = info->link.io.BasePort1; | 232 | iobase = info->p_dev->io.BasePort1; |
| 233 | 233 | ||
| 234 | avail = bt3c_read(iobase, 0x7006); | 234 | avail = bt3c_read(iobase, 0x7006); |
| 235 | //printk("bt3c_cs: receiving %d bytes\n", avail); | 235 | //printk("bt3c_cs: receiving %d bytes\n", avail); |
| @@ -350,7 +350,7 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst, struct pt_regs *regs) | |||
| 350 | return IRQ_NONE; | 350 | return IRQ_NONE; |
| 351 | } | 351 | } |
| 352 | 352 | ||
| 353 | iobase = info->link.io.BasePort1; | 353 | iobase = info->p_dev->io.BasePort1; |
| 354 | 354 | ||
| 355 | spin_lock(&(info->lock)); | 355 | spin_lock(&(info->lock)); |
| 356 | 356 | ||
| @@ -481,7 +481,7 @@ static int bt3c_load_firmware(bt3c_info_t *info, unsigned char *firmware, int co | |||
| 481 | unsigned int iobase, size, addr, fcs, tmp; | 481 | unsigned int iobase, size, addr, fcs, tmp; |
| 482 | int i, err = 0; | 482 | int i, err = 0; |
| 483 | 483 | ||
| 484 | iobase = info->link.io.BasePort1; | 484 | iobase = info->p_dev->io.BasePort1; |
| 485 | 485 | ||
| 486 | /* Reset */ | 486 | /* Reset */ |
| 487 | bt3c_io_write(iobase, 0x8040, 0x0404); | 487 | bt3c_io_write(iobase, 0x8040, 0x0404); |
| @@ -562,7 +562,6 @@ static int bt3c_open(bt3c_info_t *info) | |||
| 562 | { | 562 | { |
| 563 | const struct firmware *firmware; | 563 | const struct firmware *firmware; |
| 564 | struct hci_dev *hdev; | 564 | struct hci_dev *hdev; |
| 565 | client_handle_t handle; | ||
| 566 | int err; | 565 | int err; |
| 567 | 566 | ||
| 568 | spin_lock_init(&(info->lock)); | 567 | spin_lock_init(&(info->lock)); |
| @@ -594,10 +593,8 @@ static int bt3c_open(bt3c_info_t *info) | |||
| 594 | 593 | ||
| 595 | hdev->owner = THIS_MODULE; | 594 | hdev->owner = THIS_MODULE; |
| 596 | 595 | ||
| 597 | handle = info->link.handle; | ||
| 598 | |||
| 599 | /* Load firmware */ | 596 | /* Load firmware */ |
| 600 | err = request_firmware(&firmware, "BT3CPCC.bin", &handle_to_dev(handle)); | 597 | err = request_firmware(&firmware, "BT3CPCC.bin", &info->p_dev->dev); |
| 601 | if (err < 0) { | 598 | if (err < 0) { |
| 602 | BT_ERR("Firmware request failed"); | 599 | BT_ERR("Firmware request failed"); |
| 603 | goto error; | 600 | goto error; |
| @@ -651,14 +648,14 @@ static int bt3c_close(bt3c_info_t *info) | |||
| 651 | static int bt3c_attach(struct pcmcia_device *p_dev) | 648 | static int bt3c_attach(struct pcmcia_device *p_dev) |
| 652 | { | 649 | { |
| 653 | bt3c_info_t *info; | 650 | bt3c_info_t *info; |
| 654 | dev_link_t *link; | 651 | dev_link_t *link = dev_to_instance(p_dev); |
| 655 | 652 | ||
| 656 | /* Create new info device */ | 653 | /* Create new info device */ |
| 657 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 654 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
| 658 | if (!info) | 655 | if (!info) |
| 659 | return -ENOMEM; | 656 | return -ENOMEM; |
| 660 | 657 | ||
| 661 | link = &info->link; | 658 | info->p_dev = p_dev; |
| 662 | link->priv = info; | 659 | link->priv = info; |
| 663 | 660 | ||
| 664 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 661 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; |
| @@ -672,9 +669,6 @@ static int bt3c_attach(struct pcmcia_device *p_dev) | |||
| 672 | link->conf.Attributes = CONF_ENABLE_IRQ; | 669 | link->conf.Attributes = CONF_ENABLE_IRQ; |
| 673 | link->conf.IntType = INT_MEMORY_AND_IO; | 670 | link->conf.IntType = INT_MEMORY_AND_IO; |
| 674 | 671 | ||
| 675 | link->handle = p_dev; | ||
| 676 | p_dev->instance = link; | ||
| 677 | |||
| 678 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 672 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
| 679 | bt3c_config(link); | 673 | bt3c_config(link); |
| 680 | 674 | ||
| @@ -815,7 +809,7 @@ found_port: | |||
| 815 | goto failed; | 809 | goto failed; |
| 816 | 810 | ||
| 817 | strcpy(info->node.dev_name, info->hdev->name); | 811 | strcpy(info->node.dev_name, info->hdev->name); |
| 818 | link->dev = &info->node; | 812 | link->dev_node = &info->node; |
| 819 | link->state &= ~DEV_CONFIG_PENDING; | 813 | link->state &= ~DEV_CONFIG_PENDING; |
| 820 | 814 | ||
| 821 | return; | 815 | return; |
