aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-05 04:45:09 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:15:57 -0500
commitfd238232cd0ff4840ae6946bb338502154096d88 (patch)
treed20e8f5871f7cff9d0867a84f6ba088fbffcbe28 /drivers/bluetooth
parenta78f4dd331a4f6a396eb5849656a4a72a70a56d7 (diff)
[PATCH] pcmcia: embed dev_link_t into struct pcmcia_device
Embed dev_link_t into struct pcmcia_device(), as they basically address the same entity. The actual contents of dev_link_t will be cleaned up step by step. This patch includes a bugfix from and signed-off-by Andrew Morton. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/bluecard_cs.c31
-rw-r--r--drivers/bluetooth/bt3c_cs.c26
-rw-r--r--drivers/bluetooth/btuart_cs.c25
-rw-r--r--drivers/bluetooth/dtl1_cs.c25
4 files changed, 46 insertions, 61 deletions
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
index 8e23f9ad3e63..b461411eab3e 100644
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
@@ -65,7 +65,7 @@ MODULE_LICENSE("GPL");
65 65
66 66
67typedef struct bluecard_info_t { 67typedef struct bluecard_info_t {
68 dev_link_t link; 68 struct pcmcia_device *p_dev;
69 dev_node_t node; 69 dev_node_t node;
70 70
71 struct hci_dev *hdev; 71 struct hci_dev *hdev;
@@ -162,7 +162,7 @@ static void bluecard_detach(struct pcmcia_device *p_dev);
162static void bluecard_activity_led_timeout(u_long arg) 162static void bluecard_activity_led_timeout(u_long arg)
163{ 163{
164 bluecard_info_t *info = (bluecard_info_t *)arg; 164 bluecard_info_t *info = (bluecard_info_t *)arg;
165 unsigned int iobase = info->link.io.BasePort1; 165 unsigned int iobase = info->p_dev->io.BasePort1;
166 166
167 if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) 167 if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
168 return; 168 return;
@@ -179,7 +179,7 @@ static void bluecard_activity_led_timeout(u_long arg)
179 179
180static void bluecard_enable_activity_led(bluecard_info_t *info) 180static void bluecard_enable_activity_led(bluecard_info_t *info)
181{ 181{
182 unsigned int iobase = info->link.io.BasePort1; 182 unsigned int iobase = info->p_dev->io.BasePort1;
183 183
184 if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) 184 if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
185 return; 185 return;
@@ -235,7 +235,7 @@ static void bluecard_write_wakeup(bluecard_info_t *info)
235 } 235 }
236 236
237 do { 237 do {
238 register unsigned int iobase = info->link.io.BasePort1; 238 register unsigned int iobase = info->p_dev->io.BasePort1;
239 register unsigned int offset; 239 register unsigned int offset;
240 register unsigned char command; 240 register unsigned char command;
241 register unsigned long ready_bit; 241 register unsigned long ready_bit;
@@ -244,7 +244,7 @@ static void bluecard_write_wakeup(bluecard_info_t *info)
244 244
245 clear_bit(XMIT_WAKEUP, &(info->tx_state)); 245 clear_bit(XMIT_WAKEUP, &(info->tx_state));
246 246
247 if (!(info->link.state & DEV_PRESENT)) 247 if (!(info->p_dev->state & DEV_PRESENT))
248 return; 248 return;
249 249
250 if (test_bit(XMIT_BUFFER_NUMBER, &(info->tx_state))) { 250 if (test_bit(XMIT_BUFFER_NUMBER, &(info->tx_state))) {
@@ -382,7 +382,7 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset)
382 return; 382 return;
383 } 383 }
384 384
385 iobase = info->link.io.BasePort1; 385 iobase = info->p_dev->io.BasePort1;
386 386
387 if (test_bit(XMIT_SENDING_READY, &(info->tx_state))) 387 if (test_bit(XMIT_SENDING_READY, &(info->tx_state)))
388 bluecard_enable_activity_led(info); 388 bluecard_enable_activity_led(info);
@@ -512,7 +512,7 @@ static irqreturn_t bluecard_interrupt(int irq, void *dev_inst, struct pt_regs *r
512 if (!test_bit(CARD_READY, &(info->hw_state))) 512 if (!test_bit(CARD_READY, &(info->hw_state)))
513 return IRQ_HANDLED; 513 return IRQ_HANDLED;
514 514
515 iobase = info->link.io.BasePort1; 515 iobase = info->p_dev->io.BasePort1;
516 516
517 spin_lock(&(info->lock)); 517 spin_lock(&(info->lock));
518 518
@@ -626,7 +626,7 @@ static int bluecard_hci_flush(struct hci_dev *hdev)
626static int bluecard_hci_open(struct hci_dev *hdev) 626static int bluecard_hci_open(struct hci_dev *hdev)
627{ 627{
628 bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data); 628 bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data);
629 unsigned int iobase = info->link.io.BasePort1; 629 unsigned int iobase = info->p_dev->io.BasePort1;
630 630
631 if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) 631 if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
632 bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE); 632 bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE);
@@ -646,7 +646,7 @@ static int bluecard_hci_open(struct hci_dev *hdev)
646static int bluecard_hci_close(struct hci_dev *hdev) 646static int bluecard_hci_close(struct hci_dev *hdev)
647{ 647{
648 bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data); 648 bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data);
649 unsigned int iobase = info->link.io.BasePort1; 649 unsigned int iobase = info->p_dev->io.BasePort1;
650 650
651 if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags))) 651 if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags)))
652 return 0; 652 return 0;
@@ -713,7 +713,7 @@ static int bluecard_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned l
713 713
714static int bluecard_open(bluecard_info_t *info) 714static int bluecard_open(bluecard_info_t *info)
715{ 715{
716 unsigned int iobase = info->link.io.BasePort1; 716 unsigned int iobase = info->p_dev->io.BasePort1;
717 struct hci_dev *hdev; 717 struct hci_dev *hdev;
718 unsigned char id; 718 unsigned char id;
719 719
@@ -831,7 +831,7 @@ static int bluecard_open(bluecard_info_t *info)
831 831
832static int bluecard_close(bluecard_info_t *info) 832static int bluecard_close(bluecard_info_t *info)
833{ 833{
834 unsigned int iobase = info->link.io.BasePort1; 834 unsigned int iobase = info->p_dev->io.BasePort1;
835 struct hci_dev *hdev = info->hdev; 835 struct hci_dev *hdev = info->hdev;
836 836
837 if (!hdev) 837 if (!hdev)
@@ -859,14 +859,14 @@ static int bluecard_close(bluecard_info_t *info)
859static int bluecard_attach(struct pcmcia_device *p_dev) 859static int bluecard_attach(struct pcmcia_device *p_dev)
860{ 860{
861 bluecard_info_t *info; 861 bluecard_info_t *info;
862 dev_link_t *link; 862 dev_link_t *link = dev_to_instance(p_dev);
863 863
864 /* Create new info device */ 864 /* Create new info device */
865 info = kzalloc(sizeof(*info), GFP_KERNEL); 865 info = kzalloc(sizeof(*info), GFP_KERNEL);
866 if (!info) 866 if (!info)
867 return -ENOMEM; 867 return -ENOMEM;
868 868
869 link = &info->link; 869 info->p_dev = p_dev;
870 link->priv = info; 870 link->priv = info;
871 871
872 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 872 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
@@ -880,9 +880,6 @@ static int bluecard_attach(struct pcmcia_device *p_dev)
880 link->conf.Attributes = CONF_ENABLE_IRQ; 880 link->conf.Attributes = CONF_ENABLE_IRQ;
881 link->conf.IntType = INT_MEMORY_AND_IO; 881 link->conf.IntType = INT_MEMORY_AND_IO;
882 882
883 link->handle = p_dev;
884 p_dev->instance = link;
885
886 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 883 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
887 bluecard_config(link); 884 bluecard_config(link);
888 885
@@ -976,7 +973,7 @@ static void bluecard_config(dev_link_t *link)
976 goto failed; 973 goto failed;
977 974
978 strcpy(info->node.dev_name, info->hdev->name); 975 strcpy(info->node.dev_name, info->hdev->name);
979 link->dev = &info->node; 976 link->dev_node = &info->node;
980 link->state &= ~DEV_CONFIG_PENDING; 977 link->state &= ~DEV_CONFIG_PENDING;
981 978
982 return; 979 return;
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
74typedef struct bt3c_info_t { 74typedef 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)
651static int bt3c_attach(struct pcmcia_device *p_dev) 648static 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;
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;
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index 86617ee80e59..389a68256fe4 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -68,7 +68,7 @@ MODULE_LICENSE("GPL");
68 68
69 69
70typedef struct dtl1_info_t { 70typedef struct dtl1_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;
@@ -153,13 +153,13 @@ static void dtl1_write_wakeup(dtl1_info_t *info)
153 } 153 }
154 154
155 do { 155 do {
156 register unsigned int iobase = info->link.io.BasePort1; 156 register unsigned int iobase = info->p_dev->io.BasePort1;
157 register struct sk_buff *skb; 157 register struct sk_buff *skb;
158 register int len; 158 register int len;
159 159
160 clear_bit(XMIT_WAKEUP, &(info->tx_state)); 160 clear_bit(XMIT_WAKEUP, &(info->tx_state));
161 161
162 if (!(info->link.state & DEV_PRESENT)) 162 if (!(info->p_dev->state & DEV_PRESENT))
163 return; 163 return;
164 164
165 if (!(skb = skb_dequeue(&(info->txq)))) 165 if (!(skb = skb_dequeue(&(info->txq))))
@@ -218,7 +218,7 @@ static void dtl1_receive(dtl1_info_t *info)
218 return; 218 return;
219 } 219 }
220 220
221 iobase = info->link.io.BasePort1; 221 iobase = info->p_dev->io.BasePort1;
222 222
223 do { 223 do {
224 info->hdev->stat.byte_rx++; 224 info->hdev->stat.byte_rx++;
@@ -305,7 +305,7 @@ static irqreturn_t dtl1_interrupt(int irq, void *dev_inst, struct pt_regs *regs)
305 return IRQ_NONE; 305 return IRQ_NONE;
306 } 306 }
307 307
308 iobase = info->link.io.BasePort1; 308 iobase = info->p_dev->io.BasePort1;
309 309
310 spin_lock(&(info->lock)); 310 spin_lock(&(info->lock));
311 311
@@ -458,7 +458,7 @@ static int dtl1_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long
458static int dtl1_open(dtl1_info_t *info) 458static int dtl1_open(dtl1_info_t *info)
459{ 459{
460 unsigned long flags; 460 unsigned long flags;
461 unsigned int iobase = info->link.io.BasePort1; 461 unsigned int iobase = info->p_dev->io.BasePort1;
462 struct hci_dev *hdev; 462 struct hci_dev *hdev;
463 463
464 spin_lock_init(&(info->lock)); 464 spin_lock_init(&(info->lock));
@@ -504,7 +504,7 @@ static int dtl1_open(dtl1_info_t *info)
504 outb(UART_LCR_WLEN8, iobase + UART_LCR); /* Reset DLAB */ 504 outb(UART_LCR_WLEN8, iobase + UART_LCR); /* Reset DLAB */
505 outb((UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2), iobase + UART_MCR); 505 outb((UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2), iobase + UART_MCR);
506 506
507 info->ri_latch = inb(info->link.io.BasePort1 + UART_MSR) & UART_MSR_RI; 507 info->ri_latch = inb(info->p_dev->io.BasePort1 + UART_MSR) & UART_MSR_RI;
508 508
509 /* Turn on interrupts */ 509 /* Turn on interrupts */
510 outb(UART_IER_RLSI | UART_IER_RDI | UART_IER_THRI, iobase + UART_IER); 510 outb(UART_IER_RLSI | UART_IER_RDI | UART_IER_THRI, iobase + UART_IER);
@@ -529,7 +529,7 @@ static int dtl1_open(dtl1_info_t *info)
529static int dtl1_close(dtl1_info_t *info) 529static int dtl1_close(dtl1_info_t *info)
530{ 530{
531 unsigned long flags; 531 unsigned long flags;
532 unsigned int iobase = info->link.io.BasePort1; 532 unsigned int iobase = info->p_dev->io.BasePort1;
533 struct hci_dev *hdev = info->hdev; 533 struct hci_dev *hdev = info->hdev;
534 534
535 if (!hdev) 535 if (!hdev)
@@ -558,14 +558,14 @@ static int dtl1_close(dtl1_info_t *info)
558static int dtl1_attach(struct pcmcia_device *p_dev) 558static int dtl1_attach(struct pcmcia_device *p_dev)
559{ 559{
560 dtl1_info_t *info; 560 dtl1_info_t *info;
561 dev_link_t *link; 561 dev_link_t *link = dev_to_instance(p_dev);
562 562
563 /* Create new info device */ 563 /* Create new info device */
564 info = kzalloc(sizeof(*info), GFP_KERNEL); 564 info = kzalloc(sizeof(*info), GFP_KERNEL);
565 if (!info) 565 if (!info)
566 return -ENOMEM; 566 return -ENOMEM;
567 567
568 link = &info->link; 568 info->p_dev = p_dev;
569 link->priv = info; 569 link->priv = info;
570 570
571 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 571 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
@@ -579,9 +579,6 @@ static int dtl1_attach(struct pcmcia_device *p_dev)
579 link->conf.Attributes = CONF_ENABLE_IRQ; 579 link->conf.Attributes = CONF_ENABLE_IRQ;
580 link->conf.IntType = INT_MEMORY_AND_IO; 580 link->conf.IntType = INT_MEMORY_AND_IO;
581 581
582 link->handle = p_dev;
583 p_dev->instance = link;
584
585 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 582 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
586 dtl1_config(link); 583 dtl1_config(link);
587 584
@@ -696,7 +693,7 @@ static void dtl1_config(dev_link_t *link)
696 goto failed; 693 goto failed;
697 694
698 strcpy(info->node.dev_name, info->hdev->name); 695 strcpy(info->node.dev_name, info->hdev->name);
699 link->dev = &info->node; 696 link->dev_node = &info->node;
700 link->state &= ~DEV_CONFIG_PENDING; 697 link->state &= ~DEV_CONFIG_PENDING;
701 698
702 return; 699 return;