aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/btuart_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/bluetooth/btuart_cs.c')
-rw-r--r--drivers/bluetooth/btuart_cs.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index ec19a577b429..cfe1d74a9185 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -68,7 +68,7 @@ MODULE_LICENSE("GPL");
68 68
69 69
70typedef struct btuart_info_t { 70typedef struct btuart_info_t {
71 dev_link_t link; 71 struct pcmcia_device *p_dev;
72 dev_node_t node; 72 dev_node_t node;
73 73
74 struct hci_dev *hdev; 74 struct hci_dev *hdev;
@@ -146,13 +146,13 @@ static void btuart_write_wakeup(btuart_info_t *info)
146 } 146 }
147 147
148 do { 148 do {
149 register unsigned int iobase = info->link.io.BasePort1; 149 register unsigned int iobase = info->p_dev->io.BasePort1;
150 register struct sk_buff *skb; 150 register struct sk_buff *skb;
151 register int len; 151 register int len;
152 152
153 clear_bit(XMIT_WAKEUP, &(info->tx_state)); 153 clear_bit(XMIT_WAKEUP, &(info->tx_state));
154 154
155 if (!(info->link.state & DEV_PRESENT)) 155 if (!(info->p_dev->state & DEV_PRESENT))
156 return; 156 return;
157 157
158 if (!(skb = skb_dequeue(&(info->txq)))) 158 if (!(skb = skb_dequeue(&(info->txq))))
@@ -187,7 +187,7 @@ static void btuart_receive(btuart_info_t *info)
187 return; 187 return;
188 } 188 }
189 189
190 iobase = info->link.io.BasePort1; 190 iobase = info->p_dev->io.BasePort1;
191 191
192 do { 192 do {
193 info->hdev->stat.byte_rx++; 193 info->hdev->stat.byte_rx++;
@@ -301,7 +301,7 @@ static irqreturn_t btuart_interrupt(int irq, void *dev_inst, struct pt_regs *reg
301 return IRQ_NONE; 301 return IRQ_NONE;
302 } 302 }
303 303
304 iobase = info->link.io.BasePort1; 304 iobase = info->p_dev->io.BasePort1;
305 305
306 spin_lock(&(info->lock)); 306 spin_lock(&(info->lock));
307 307
@@ -357,7 +357,7 @@ static void btuart_change_speed(btuart_info_t *info, unsigned int speed)
357 return; 357 return;
358 } 358 }
359 359
360 iobase = info->link.io.BasePort1; 360 iobase = info->p_dev->io.BasePort1;
361 361
362 spin_lock_irqsave(&(info->lock), flags); 362 spin_lock_irqsave(&(info->lock), flags);
363 363
@@ -481,7 +481,7 @@ static int btuart_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned lon
481static int btuart_open(btuart_info_t *info) 481static int btuart_open(btuart_info_t *info)
482{ 482{
483 unsigned long flags; 483 unsigned long flags;
484 unsigned int iobase = info->link.io.BasePort1; 484 unsigned int iobase = info->p_dev->io.BasePort1;
485 struct hci_dev *hdev; 485 struct hci_dev *hdev;
486 486
487 spin_lock_init(&(info->lock)); 487 spin_lock_init(&(info->lock));
@@ -550,7 +550,7 @@ static int btuart_open(btuart_info_t *info)
550static int btuart_close(btuart_info_t *info) 550static int btuart_close(btuart_info_t *info)
551{ 551{
552 unsigned long flags; 552 unsigned long flags;
553 unsigned int iobase = info->link.io.BasePort1; 553 unsigned int iobase = info->p_dev->io.BasePort1;
554 struct hci_dev *hdev = info->hdev; 554 struct hci_dev *hdev = info->hdev;
555 555
556 if (!hdev) 556 if (!hdev)
@@ -579,14 +579,14 @@ static int btuart_close(btuart_info_t *info)
579static int btuart_attach(struct pcmcia_device *p_dev) 579static int btuart_attach(struct pcmcia_device *p_dev)
580{ 580{
581 btuart_info_t *info; 581 btuart_info_t *info;
582 dev_link_t *link; 582 dev_link_t *link = dev_to_instance(p_dev);
583 583
584 /* Create new info device */ 584 /* Create new info device */
585 info = kzalloc(sizeof(*info), GFP_KERNEL); 585 info = kzalloc(sizeof(*info), GFP_KERNEL);
586 if (!info) 586 if (!info)
587 return -ENOMEM; 587 return -ENOMEM;
588 588
589 link = &info->link; 589 info->p_dev = p_dev;
590 link->priv = info; 590 link->priv = info;
591 591
592 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 592 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
@@ -600,9 +600,6 @@ static int btuart_attach(struct pcmcia_device *p_dev)
600 link->conf.Attributes = CONF_ENABLE_IRQ; 600 link->conf.Attributes = CONF_ENABLE_IRQ;
601 link->conf.IntType = INT_MEMORY_AND_IO; 601 link->conf.IntType = INT_MEMORY_AND_IO;
602 602
603 link->handle = p_dev;
604 p_dev->instance = link;
605
606 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 603 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
607 btuart_config(link); 604 btuart_config(link);
608 605
@@ -744,7 +741,7 @@ found_port:
744 goto failed; 741 goto failed;
745 742
746 strcpy(info->node.dev_name, info->hdev->name); 743 strcpy(info->node.dev_name, info->hdev->name);
747 link->dev = &info->node; 744 link->dev_node = &info->node;
748 link->state &= ~DEV_CONFIG_PENDING; 745 link->state &= ~DEV_CONFIG_PENDING;
749 746
750 return; 747 return;