aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/dtl1_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:21:06 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:21:06 -0500
commitfba395eee7d3f342ca739c20f5b3ee635d0420a0 (patch)
tree5a73f68d3514aa795b0d8c500e4d72170651d762 /drivers/bluetooth/dtl1_cs.c
parentfd238232cd0ff4840ae6946bb338502154096d88 (diff)
[PATCH] pcmcia: remove dev_link_t and client_handle_t indirection
dev_link_t * and client_handle_t both mean struct pcmcai_device * by now. Therefore, remove all such indirections. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/bluetooth/dtl1_cs.c')
-rw-r--r--drivers/bluetooth/dtl1_cs.c45
1 files changed, 21 insertions, 24 deletions
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index 389a68256fe4..416433b4a348 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -87,8 +87,8 @@ typedef struct dtl1_info_t {
87} dtl1_info_t; 87} dtl1_info_t;
88 88
89 89
90static void dtl1_config(dev_link_t *link); 90static void dtl1_config(struct pcmcia_device *link);
91static void dtl1_release(dev_link_t *link); 91static void dtl1_release(struct pcmcia_device *link);
92 92
93static void dtl1_detach(struct pcmcia_device *p_dev); 93static void dtl1_detach(struct pcmcia_device *p_dev);
94 94
@@ -555,17 +555,16 @@ static int dtl1_close(dtl1_info_t *info)
555 return 0; 555 return 0;
556} 556}
557 557
558static int dtl1_attach(struct pcmcia_device *p_dev) 558static int dtl1_attach(struct pcmcia_device *link)
559{ 559{
560 dtl1_info_t *info; 560 dtl1_info_t *info;
561 dev_link_t *link = dev_to_instance(p_dev);
562 561
563 /* Create new info device */ 562 /* Create new info device */
564 info = kzalloc(sizeof(*info), GFP_KERNEL); 563 info = kzalloc(sizeof(*info), GFP_KERNEL);
565 if (!info) 564 if (!info)
566 return -ENOMEM; 565 return -ENOMEM;
567 566
568 info->p_dev = p_dev; 567 info->p_dev = link;
569 link->priv = info; 568 link->priv = info;
570 569
571 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 570 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
@@ -586,9 +585,8 @@ static int dtl1_attach(struct pcmcia_device *p_dev)
586} 585}
587 586
588 587
589static void dtl1_detach(struct pcmcia_device *p_dev) 588static void dtl1_detach(struct pcmcia_device *link)
590{ 589{
591 dev_link_t *link = dev_to_instance(p_dev);
592 dtl1_info_t *info = link->priv; 590 dtl1_info_t *info = link->priv;
593 591
594 if (link->state & DEV_CONFIG) 592 if (link->state & DEV_CONFIG)
@@ -597,7 +595,7 @@ static void dtl1_detach(struct pcmcia_device *p_dev)
597 kfree(info); 595 kfree(info);
598} 596}
599 597
600static int get_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) 598static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse)
601{ 599{
602 int i; 600 int i;
603 601
@@ -608,23 +606,22 @@ static int get_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
608 return pcmcia_parse_tuple(handle, tuple, parse); 606 return pcmcia_parse_tuple(handle, tuple, parse);
609} 607}
610 608
611static int first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) 609static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse)
612{ 610{
613 if (pcmcia_get_first_tuple(handle, tuple) != CS_SUCCESS) 611 if (pcmcia_get_first_tuple(handle, tuple) != CS_SUCCESS)
614 return CS_NO_MORE_ITEMS; 612 return CS_NO_MORE_ITEMS;
615 return get_tuple(handle, tuple, parse); 613 return get_tuple(handle, tuple, parse);
616} 614}
617 615
618static int next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) 616static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse)
619{ 617{
620 if (pcmcia_get_next_tuple(handle, tuple) != CS_SUCCESS) 618 if (pcmcia_get_next_tuple(handle, tuple) != CS_SUCCESS)
621 return CS_NO_MORE_ITEMS; 619 return CS_NO_MORE_ITEMS;
622 return get_tuple(handle, tuple, parse); 620 return get_tuple(handle, tuple, parse);
623} 621}
624 622
625static void dtl1_config(dev_link_t *link) 623static void dtl1_config(struct pcmcia_device *link)
626{ 624{
627 client_handle_t handle = link->handle;
628 dtl1_info_t *info = link->priv; 625 dtl1_info_t *info = link->priv;
629 tuple_t tuple; 626 tuple_t tuple;
630 u_short buf[256]; 627 u_short buf[256];
@@ -639,7 +636,7 @@ static void dtl1_config(dev_link_t *link)
639 636
640 /* Get configuration register information */ 637 /* Get configuration register information */
641 tuple.DesiredTuple = CISTPL_CONFIG; 638 tuple.DesiredTuple = CISTPL_CONFIG;
642 last_ret = first_tuple(handle, &tuple, &parse); 639 last_ret = first_tuple(link, &tuple, &parse);
643 if (last_ret != CS_SUCCESS) { 640 if (last_ret != CS_SUCCESS) {
644 last_fn = ParseTuple; 641 last_fn = ParseTuple;
645 goto cs_failed; 642 goto cs_failed;
@@ -658,34 +655,34 @@ static void dtl1_config(dev_link_t *link)
658 655
659 /* Look for a generic full-sized window */ 656 /* Look for a generic full-sized window */
660 link->io.NumPorts1 = 8; 657 link->io.NumPorts1 = 8;
661 i = first_tuple(handle, &tuple, &parse); 658 i = first_tuple(link, &tuple, &parse);
662 while (i != CS_NO_MORE_ITEMS) { 659 while (i != CS_NO_MORE_ITEMS) {
663 if ((i == CS_SUCCESS) && (cf->io.nwin == 1) && (cf->io.win[0].len > 8)) { 660 if ((i == CS_SUCCESS) && (cf->io.nwin == 1) && (cf->io.win[0].len > 8)) {
664 link->conf.ConfigIndex = cf->index; 661 link->conf.ConfigIndex = cf->index;
665 link->io.BasePort1 = cf->io.win[0].base; 662 link->io.BasePort1 = cf->io.win[0].base;
666 link->io.NumPorts1 = cf->io.win[0].len; /*yo */ 663 link->io.NumPorts1 = cf->io.win[0].len; /*yo */
667 link->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK; 664 link->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK;
668 i = pcmcia_request_io(link->handle, &link->io); 665 i = pcmcia_request_io(link, &link->io);
669 if (i == CS_SUCCESS) 666 if (i == CS_SUCCESS)
670 break; 667 break;
671 } 668 }
672 i = next_tuple(handle, &tuple, &parse); 669 i = next_tuple(link, &tuple, &parse);
673 } 670 }
674 671
675 if (i != CS_SUCCESS) { 672 if (i != CS_SUCCESS) {
676 cs_error(link->handle, RequestIO, i); 673 cs_error(link, RequestIO, i);
677 goto failed; 674 goto failed;
678 } 675 }
679 676
680 i = pcmcia_request_irq(link->handle, &link->irq); 677 i = pcmcia_request_irq(link, &link->irq);
681 if (i != CS_SUCCESS) { 678 if (i != CS_SUCCESS) {
682 cs_error(link->handle, RequestIRQ, i); 679 cs_error(link, RequestIRQ, i);
683 link->irq.AssignedIRQ = 0; 680 link->irq.AssignedIRQ = 0;
684 } 681 }
685 682
686 i = pcmcia_request_configuration(link->handle, &link->conf); 683 i = pcmcia_request_configuration(link, &link->conf);
687 if (i != CS_SUCCESS) { 684 if (i != CS_SUCCESS) {
688 cs_error(link->handle, RequestConfiguration, i); 685 cs_error(link, RequestConfiguration, i);
689 goto failed; 686 goto failed;
690 } 687 }
691 688
@@ -699,21 +696,21 @@ static void dtl1_config(dev_link_t *link)
699 return; 696 return;
700 697
701cs_failed: 698cs_failed:
702 cs_error(link->handle, last_fn, last_ret); 699 cs_error(link, last_fn, last_ret);
703 700
704failed: 701failed:
705 dtl1_release(link); 702 dtl1_release(link);
706} 703}
707 704
708 705
709static void dtl1_release(dev_link_t *link) 706static void dtl1_release(struct pcmcia_device *link)
710{ 707{
711 dtl1_info_t *info = link->priv; 708 dtl1_info_t *info = link->priv;
712 709
713 if (link->state & DEV_PRESENT) 710 if (link->state & DEV_PRESENT)
714 dtl1_close(info); 711 dtl1_close(info);
715 712
716 pcmcia_disable_device(link->handle); 713 pcmcia_disable_device(link);
717} 714}
718 715
719 716