diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:21:06 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:21:06 -0500 |
commit | fba395eee7d3f342ca739c20f5b3ee635d0420a0 (patch) | |
tree | 5a73f68d3514aa795b0d8c500e4d72170651d762 /drivers/bluetooth | |
parent | fd238232cd0ff4840ae6946bb338502154096d88 (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')
-rw-r--r-- | drivers/bluetooth/bluecard_cs.c | 37 | ||||
-rw-r--r-- | drivers/bluetooth/bt3c_cs.c | 51 | ||||
-rw-r--r-- | drivers/bluetooth/btuart_cs.c | 51 | ||||
-rw-r--r-- | drivers/bluetooth/dtl1_cs.c | 45 |
4 files changed, 86 insertions, 98 deletions
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c index b461411eab3e..e557f2359ccc 100644 --- a/drivers/bluetooth/bluecard_cs.c +++ b/drivers/bluetooth/bluecard_cs.c | |||
@@ -85,8 +85,8 @@ typedef struct bluecard_info_t { | |||
85 | } bluecard_info_t; | 85 | } bluecard_info_t; |
86 | 86 | ||
87 | 87 | ||
88 | static void bluecard_config(dev_link_t *link); | 88 | static void bluecard_config(struct pcmcia_device *link); |
89 | static void bluecard_release(dev_link_t *link); | 89 | static void bluecard_release(struct pcmcia_device *link); |
90 | 90 | ||
91 | static void bluecard_detach(struct pcmcia_device *p_dev); | 91 | static void bluecard_detach(struct pcmcia_device *p_dev); |
92 | 92 | ||
@@ -856,17 +856,16 @@ static int bluecard_close(bluecard_info_t *info) | |||
856 | return 0; | 856 | return 0; |
857 | } | 857 | } |
858 | 858 | ||
859 | static int bluecard_attach(struct pcmcia_device *p_dev) | 859 | static int bluecard_attach(struct pcmcia_device *link) |
860 | { | 860 | { |
861 | bluecard_info_t *info; | 861 | bluecard_info_t *info; |
862 | dev_link_t *link = dev_to_instance(p_dev); | ||
863 | 862 | ||
864 | /* Create new info device */ | 863 | /* Create new info device */ |
865 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 864 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
866 | if (!info) | 865 | if (!info) |
867 | return -ENOMEM; | 866 | return -ENOMEM; |
868 | 867 | ||
869 | info->p_dev = p_dev; | 868 | info->p_dev = link; |
870 | link->priv = info; | 869 | link->priv = info; |
871 | 870 | ||
872 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 871 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; |
@@ -887,9 +886,8 @@ static int bluecard_attach(struct pcmcia_device *p_dev) | |||
887 | } | 886 | } |
888 | 887 | ||
889 | 888 | ||
890 | static void bluecard_detach(struct pcmcia_device *p_dev) | 889 | static void bluecard_detach(struct pcmcia_device *link) |
891 | { | 890 | { |
892 | dev_link_t *link = dev_to_instance(p_dev); | ||
893 | bluecard_info_t *info = link->priv; | 891 | bluecard_info_t *info = link->priv; |
894 | 892 | ||
895 | if (link->state & DEV_CONFIG) | 893 | if (link->state & DEV_CONFIG) |
@@ -899,7 +897,7 @@ static void bluecard_detach(struct pcmcia_device *p_dev) | |||
899 | } | 897 | } |
900 | 898 | ||
901 | 899 | ||
902 | static int first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) | 900 | static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) |
903 | { | 901 | { |
904 | int i; | 902 | int i; |
905 | 903 | ||
@@ -914,9 +912,8 @@ static int first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse | |||
914 | return pcmcia_parse_tuple(handle, tuple, parse); | 912 | return pcmcia_parse_tuple(handle, tuple, parse); |
915 | } | 913 | } |
916 | 914 | ||
917 | static void bluecard_config(dev_link_t *link) | 915 | static void bluecard_config(struct pcmcia_device *link) |
918 | { | 916 | { |
919 | client_handle_t handle = link->handle; | ||
920 | bluecard_info_t *info = link->priv; | 917 | bluecard_info_t *info = link->priv; |
921 | tuple_t tuple; | 918 | tuple_t tuple; |
922 | u_short buf[256]; | 919 | u_short buf[256]; |
@@ -930,7 +927,7 @@ static void bluecard_config(dev_link_t *link) | |||
930 | 927 | ||
931 | /* Get configuration register information */ | 928 | /* Get configuration register information */ |
932 | tuple.DesiredTuple = CISTPL_CONFIG; | 929 | tuple.DesiredTuple = CISTPL_CONFIG; |
933 | last_ret = first_tuple(handle, &tuple, &parse); | 930 | last_ret = first_tuple(link, &tuple, &parse); |
934 | if (last_ret != CS_SUCCESS) { | 931 | if (last_ret != CS_SUCCESS) { |
935 | last_fn = ParseTuple; | 932 | last_fn = ParseTuple; |
936 | goto cs_failed; | 933 | goto cs_failed; |
@@ -947,25 +944,25 @@ static void bluecard_config(dev_link_t *link) | |||
947 | 944 | ||
948 | for (n = 0; n < 0x400; n += 0x40) { | 945 | for (n = 0; n < 0x400; n += 0x40) { |
949 | link->io.BasePort1 = n ^ 0x300; | 946 | link->io.BasePort1 = n ^ 0x300; |
950 | i = pcmcia_request_io(link->handle, &link->io); | 947 | i = pcmcia_request_io(link, &link->io); |
951 | if (i == CS_SUCCESS) | 948 | if (i == CS_SUCCESS) |
952 | break; | 949 | break; |
953 | } | 950 | } |
954 | 951 | ||
955 | if (i != CS_SUCCESS) { | 952 | if (i != CS_SUCCESS) { |
956 | cs_error(link->handle, RequestIO, i); | 953 | cs_error(link, RequestIO, i); |
957 | goto failed; | 954 | goto failed; |
958 | } | 955 | } |
959 | 956 | ||
960 | i = pcmcia_request_irq(link->handle, &link->irq); | 957 | i = pcmcia_request_irq(link, &link->irq); |
961 | if (i != CS_SUCCESS) { | 958 | if (i != CS_SUCCESS) { |
962 | cs_error(link->handle, RequestIRQ, i); | 959 | cs_error(link, RequestIRQ, i); |
963 | link->irq.AssignedIRQ = 0; | 960 | link->irq.AssignedIRQ = 0; |
964 | } | 961 | } |
965 | 962 | ||
966 | i = pcmcia_request_configuration(link->handle, &link->conf); | 963 | i = pcmcia_request_configuration(link, &link->conf); |
967 | if (i != CS_SUCCESS) { | 964 | if (i != CS_SUCCESS) { |
968 | cs_error(link->handle, RequestConfiguration, i); | 965 | cs_error(link, RequestConfiguration, i); |
969 | goto failed; | 966 | goto failed; |
970 | } | 967 | } |
971 | 968 | ||
@@ -979,14 +976,14 @@ static void bluecard_config(dev_link_t *link) | |||
979 | return; | 976 | return; |
980 | 977 | ||
981 | cs_failed: | 978 | cs_failed: |
982 | cs_error(link->handle, last_fn, last_ret); | 979 | cs_error(link, last_fn, last_ret); |
983 | 980 | ||
984 | failed: | 981 | failed: |
985 | bluecard_release(link); | 982 | bluecard_release(link); |
986 | } | 983 | } |
987 | 984 | ||
988 | 985 | ||
989 | static void bluecard_release(dev_link_t *link) | 986 | static void bluecard_release(struct pcmcia_device *link) |
990 | { | 987 | { |
991 | bluecard_info_t *info = link->priv; | 988 | bluecard_info_t *info = link->priv; |
992 | 989 | ||
@@ -995,7 +992,7 @@ static void bluecard_release(dev_link_t *link) | |||
995 | 992 | ||
996 | del_timer(&(info->timer)); | 993 | del_timer(&(info->timer)); |
997 | 994 | ||
998 | pcmcia_disable_device(link->handle); | 995 | pcmcia_disable_device(link); |
999 | } | 996 | } |
1000 | 997 | ||
1001 | static struct pcmcia_device_id bluecard_ids[] = { | 998 | static struct pcmcia_device_id bluecard_ids[] = { |
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c index 9192a754ebc0..7ea8fa350d26 100644 --- a/drivers/bluetooth/bt3c_cs.c +++ b/drivers/bluetooth/bt3c_cs.c | |||
@@ -88,8 +88,8 @@ typedef struct bt3c_info_t { | |||
88 | } bt3c_info_t; | 88 | } bt3c_info_t; |
89 | 89 | ||
90 | 90 | ||
91 | static void bt3c_config(dev_link_t *link); | 91 | static void bt3c_config(struct pcmcia_device *link); |
92 | static void bt3c_release(dev_link_t *link); | 92 | static void bt3c_release(struct pcmcia_device *link); |
93 | 93 | ||
94 | static void bt3c_detach(struct pcmcia_device *p_dev); | 94 | static void bt3c_detach(struct pcmcia_device *p_dev); |
95 | 95 | ||
@@ -645,17 +645,16 @@ static int bt3c_close(bt3c_info_t *info) | |||
645 | return 0; | 645 | return 0; |
646 | } | 646 | } |
647 | 647 | ||
648 | static int bt3c_attach(struct pcmcia_device *p_dev) | 648 | static int bt3c_attach(struct pcmcia_device *link) |
649 | { | 649 | { |
650 | bt3c_info_t *info; | 650 | bt3c_info_t *info; |
651 | dev_link_t *link = dev_to_instance(p_dev); | ||
652 | 651 | ||
653 | /* Create new info device */ | 652 | /* Create new info device */ |
654 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 653 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
655 | if (!info) | 654 | if (!info) |
656 | return -ENOMEM; | 655 | return -ENOMEM; |
657 | 656 | ||
658 | info->p_dev = p_dev; | 657 | info->p_dev = link; |
659 | link->priv = info; | 658 | link->priv = info; |
660 | 659 | ||
661 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 660 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; |
@@ -676,9 +675,8 @@ static int bt3c_attach(struct pcmcia_device *p_dev) | |||
676 | } | 675 | } |
677 | 676 | ||
678 | 677 | ||
679 | static void bt3c_detach(struct pcmcia_device *p_dev) | 678 | static void bt3c_detach(struct pcmcia_device *link) |
680 | { | 679 | { |
681 | dev_link_t *link = dev_to_instance(p_dev); | ||
682 | bt3c_info_t *info = link->priv; | 680 | bt3c_info_t *info = link->priv; |
683 | 681 | ||
684 | if (link->state & DEV_CONFIG) | 682 | if (link->state & DEV_CONFIG) |
@@ -687,7 +685,7 @@ static void bt3c_detach(struct pcmcia_device *p_dev) | |||
687 | kfree(info); | 685 | kfree(info); |
688 | } | 686 | } |
689 | 687 | ||
690 | static int get_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) | 688 | static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) |
691 | { | 689 | { |
692 | int i; | 690 | int i; |
693 | 691 | ||
@@ -698,24 +696,23 @@ static int get_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) | |||
698 | return pcmcia_parse_tuple(handle, tuple, parse); | 696 | return pcmcia_parse_tuple(handle, tuple, parse); |
699 | } | 697 | } |
700 | 698 | ||
701 | static int first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) | 699 | static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) |
702 | { | 700 | { |
703 | if (pcmcia_get_first_tuple(handle, tuple) != CS_SUCCESS) | 701 | if (pcmcia_get_first_tuple(handle, tuple) != CS_SUCCESS) |
704 | return CS_NO_MORE_ITEMS; | 702 | return CS_NO_MORE_ITEMS; |
705 | return get_tuple(handle, tuple, parse); | 703 | return get_tuple(handle, tuple, parse); |
706 | } | 704 | } |
707 | 705 | ||
708 | static int next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) | 706 | static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) |
709 | { | 707 | { |
710 | if (pcmcia_get_next_tuple(handle, tuple) != CS_SUCCESS) | 708 | if (pcmcia_get_next_tuple(handle, tuple) != CS_SUCCESS) |
711 | return CS_NO_MORE_ITEMS; | 709 | return CS_NO_MORE_ITEMS; |
712 | return get_tuple(handle, tuple, parse); | 710 | return get_tuple(handle, tuple, parse); |
713 | } | 711 | } |
714 | 712 | ||
715 | static void bt3c_config(dev_link_t *link) | 713 | static void bt3c_config(struct pcmcia_device *link) |
716 | { | 714 | { |
717 | static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; | 715 | static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; |
718 | client_handle_t handle = link->handle; | ||
719 | bt3c_info_t *info = link->priv; | 716 | bt3c_info_t *info = link->priv; |
720 | tuple_t tuple; | 717 | tuple_t tuple; |
721 | u_short buf[256]; | 718 | u_short buf[256]; |
@@ -730,7 +727,7 @@ static void bt3c_config(dev_link_t *link) | |||
730 | 727 | ||
731 | /* Get configuration register information */ | 728 | /* Get configuration register information */ |
732 | tuple.DesiredTuple = CISTPL_CONFIG; | 729 | tuple.DesiredTuple = CISTPL_CONFIG; |
733 | last_ret = first_tuple(handle, &tuple, &parse); | 730 | last_ret = first_tuple(link, &tuple, &parse); |
734 | if (last_ret != CS_SUCCESS) { | 731 | if (last_ret != CS_SUCCESS) { |
735 | last_fn = ParseTuple; | 732 | last_fn = ParseTuple; |
736 | goto cs_failed; | 733 | goto cs_failed; |
@@ -749,7 +746,7 @@ static void bt3c_config(dev_link_t *link) | |||
749 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 746 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
750 | /* Two tries: without IO aliases, then with aliases */ | 747 | /* Two tries: without IO aliases, then with aliases */ |
751 | for (try = 0; try < 2; try++) { | 748 | for (try = 0; try < 2; try++) { |
752 | i = first_tuple(handle, &tuple, &parse); | 749 | i = first_tuple(link, &tuple, &parse); |
753 | while (i != CS_NO_MORE_ITEMS) { | 750 | while (i != CS_NO_MORE_ITEMS) { |
754 | if (i != CS_SUCCESS) | 751 | if (i != CS_SUCCESS) |
755 | goto next_entry; | 752 | goto next_entry; |
@@ -759,49 +756,49 @@ static void bt3c_config(dev_link_t *link) | |||
759 | link->conf.ConfigIndex = cf->index; | 756 | link->conf.ConfigIndex = cf->index; |
760 | link->io.BasePort1 = cf->io.win[0].base; | 757 | link->io.BasePort1 = cf->io.win[0].base; |
761 | link->io.IOAddrLines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK; | 758 | link->io.IOAddrLines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK; |
762 | i = pcmcia_request_io(link->handle, &link->io); | 759 | i = pcmcia_request_io(link, &link->io); |
763 | if (i == CS_SUCCESS) | 760 | if (i == CS_SUCCESS) |
764 | goto found_port; | 761 | goto found_port; |
765 | } | 762 | } |
766 | next_entry: | 763 | next_entry: |
767 | i = next_tuple(handle, &tuple, &parse); | 764 | i = next_tuple(link, &tuple, &parse); |
768 | } | 765 | } |
769 | } | 766 | } |
770 | 767 | ||
771 | /* Second pass: try to find an entry that isn't picky about | 768 | /* Second pass: try to find an entry that isn't picky about |
772 | its base address, then try to grab any standard serial port | 769 | its base address, then try to grab any standard serial port |
773 | address, and finally try to get any free port. */ | 770 | address, and finally try to get any free port. */ |
774 | i = first_tuple(handle, &tuple, &parse); | 771 | i = first_tuple(link, &tuple, &parse); |
775 | while (i != CS_NO_MORE_ITEMS) { | 772 | while (i != CS_NO_MORE_ITEMS) { |
776 | if ((i == CS_SUCCESS) && (cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { | 773 | if ((i == CS_SUCCESS) && (cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { |
777 | link->conf.ConfigIndex = cf->index; | 774 | link->conf.ConfigIndex = cf->index; |
778 | for (j = 0; j < 5; j++) { | 775 | for (j = 0; j < 5; j++) { |
779 | link->io.BasePort1 = base[j]; | 776 | link->io.BasePort1 = base[j]; |
780 | link->io.IOAddrLines = base[j] ? 16 : 3; | 777 | link->io.IOAddrLines = base[j] ? 16 : 3; |
781 | i = pcmcia_request_io(link->handle, &link->io); | 778 | i = pcmcia_request_io(link, &link->io); |
782 | if (i == CS_SUCCESS) | 779 | if (i == CS_SUCCESS) |
783 | goto found_port; | 780 | goto found_port; |
784 | } | 781 | } |
785 | } | 782 | } |
786 | i = next_tuple(handle, &tuple, &parse); | 783 | i = next_tuple(link, &tuple, &parse); |
787 | } | 784 | } |
788 | 785 | ||
789 | found_port: | 786 | found_port: |
790 | if (i != CS_SUCCESS) { | 787 | if (i != CS_SUCCESS) { |
791 | BT_ERR("No usable port range found"); | 788 | BT_ERR("No usable port range found"); |
792 | cs_error(link->handle, RequestIO, i); | 789 | cs_error(link, RequestIO, i); |
793 | goto failed; | 790 | goto failed; |
794 | } | 791 | } |
795 | 792 | ||
796 | i = pcmcia_request_irq(link->handle, &link->irq); | 793 | i = pcmcia_request_irq(link, &link->irq); |
797 | if (i != CS_SUCCESS) { | 794 | if (i != CS_SUCCESS) { |
798 | cs_error(link->handle, RequestIRQ, i); | 795 | cs_error(link, RequestIRQ, i); |
799 | link->irq.AssignedIRQ = 0; | 796 | link->irq.AssignedIRQ = 0; |
800 | } | 797 | } |
801 | 798 | ||
802 | i = pcmcia_request_configuration(link->handle, &link->conf); | 799 | i = pcmcia_request_configuration(link, &link->conf); |
803 | if (i != CS_SUCCESS) { | 800 | if (i != CS_SUCCESS) { |
804 | cs_error(link->handle, RequestConfiguration, i); | 801 | cs_error(link, RequestConfiguration, i); |
805 | goto failed; | 802 | goto failed; |
806 | } | 803 | } |
807 | 804 | ||
@@ -815,21 +812,21 @@ found_port: | |||
815 | return; | 812 | return; |
816 | 813 | ||
817 | cs_failed: | 814 | cs_failed: |
818 | cs_error(link->handle, last_fn, last_ret); | 815 | cs_error(link, last_fn, last_ret); |
819 | 816 | ||
820 | failed: | 817 | failed: |
821 | bt3c_release(link); | 818 | bt3c_release(link); |
822 | } | 819 | } |
823 | 820 | ||
824 | 821 | ||
825 | static void bt3c_release(dev_link_t *link) | 822 | static void bt3c_release(struct pcmcia_device *link) |
826 | { | 823 | { |
827 | bt3c_info_t *info = link->priv; | 824 | bt3c_info_t *info = link->priv; |
828 | 825 | ||
829 | if (link->state & DEV_PRESENT) | 826 | if (link->state & DEV_PRESENT) |
830 | bt3c_close(info); | 827 | bt3c_close(info); |
831 | 828 | ||
832 | pcmcia_disable_device(link->handle); | 829 | pcmcia_disable_device(link); |
833 | } | 830 | } |
834 | 831 | ||
835 | 832 | ||
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c index cfe1d74a9185..594839061360 100644 --- a/drivers/bluetooth/btuart_cs.c +++ b/drivers/bluetooth/btuart_cs.c | |||
@@ -84,8 +84,8 @@ typedef struct btuart_info_t { | |||
84 | } btuart_info_t; | 84 | } btuart_info_t; |
85 | 85 | ||
86 | 86 | ||
87 | static void btuart_config(dev_link_t *link); | 87 | static void btuart_config(struct pcmcia_device *link); |
88 | static void btuart_release(dev_link_t *link); | 88 | static void btuart_release(struct pcmcia_device *link); |
89 | 89 | ||
90 | static void btuart_detach(struct pcmcia_device *p_dev); | 90 | static void btuart_detach(struct pcmcia_device *p_dev); |
91 | 91 | ||
@@ -576,17 +576,16 @@ static int btuart_close(btuart_info_t *info) | |||
576 | return 0; | 576 | return 0; |
577 | } | 577 | } |
578 | 578 | ||
579 | static int btuart_attach(struct pcmcia_device *p_dev) | 579 | static int btuart_attach(struct pcmcia_device *link) |
580 | { | 580 | { |
581 | btuart_info_t *info; | 581 | btuart_info_t *info; |
582 | dev_link_t *link = dev_to_instance(p_dev); | ||
583 | 582 | ||
584 | /* Create new info device */ | 583 | /* Create new info device */ |
585 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 584 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
586 | if (!info) | 585 | if (!info) |
587 | return -ENOMEM; | 586 | return -ENOMEM; |
588 | 587 | ||
589 | info->p_dev = p_dev; | 588 | info->p_dev = link; |
590 | link->priv = info; | 589 | link->priv = info; |
591 | 590 | ||
592 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 591 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; |
@@ -607,9 +606,8 @@ static int btuart_attach(struct pcmcia_device *p_dev) | |||
607 | } | 606 | } |
608 | 607 | ||
609 | 608 | ||
610 | static void btuart_detach(struct pcmcia_device *p_dev) | 609 | static void btuart_detach(struct pcmcia_device *link) |
611 | { | 610 | { |
612 | dev_link_t *link = dev_to_instance(p_dev); | ||
613 | btuart_info_t *info = link->priv; | 611 | btuart_info_t *info = link->priv; |
614 | 612 | ||
615 | if (link->state & DEV_CONFIG) | 613 | if (link->state & DEV_CONFIG) |
@@ -618,7 +616,7 @@ static void btuart_detach(struct pcmcia_device *p_dev) | |||
618 | kfree(info); | 616 | kfree(info); |
619 | } | 617 | } |
620 | 618 | ||
621 | static int get_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) | 619 | static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) |
622 | { | 620 | { |
623 | int i; | 621 | int i; |
624 | 622 | ||
@@ -629,24 +627,23 @@ static int get_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) | |||
629 | return pcmcia_parse_tuple(handle, tuple, parse); | 627 | return pcmcia_parse_tuple(handle, tuple, parse); |
630 | } | 628 | } |
631 | 629 | ||
632 | static int first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) | 630 | static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) |
633 | { | 631 | { |
634 | if (pcmcia_get_first_tuple(handle, tuple) != CS_SUCCESS) | 632 | if (pcmcia_get_first_tuple(handle, tuple) != CS_SUCCESS) |
635 | return CS_NO_MORE_ITEMS; | 633 | return CS_NO_MORE_ITEMS; |
636 | return get_tuple(handle, tuple, parse); | 634 | return get_tuple(handle, tuple, parse); |
637 | } | 635 | } |
638 | 636 | ||
639 | static int next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) | 637 | static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) |
640 | { | 638 | { |
641 | if (pcmcia_get_next_tuple(handle, tuple) != CS_SUCCESS) | 639 | if (pcmcia_get_next_tuple(handle, tuple) != CS_SUCCESS) |
642 | return CS_NO_MORE_ITEMS; | 640 | return CS_NO_MORE_ITEMS; |
643 | return get_tuple(handle, tuple, parse); | 641 | return get_tuple(handle, tuple, parse); |
644 | } | 642 | } |
645 | 643 | ||
646 | static void btuart_config(dev_link_t *link) | 644 | static void btuart_config(struct pcmcia_device *link) |
647 | { | 645 | { |
648 | static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; | 646 | static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; |
649 | client_handle_t handle = link->handle; | ||
650 | btuart_info_t *info = link->priv; | 647 | btuart_info_t *info = link->priv; |
651 | tuple_t tuple; | 648 | tuple_t tuple; |
652 | u_short buf[256]; | 649 | u_short buf[256]; |
@@ -661,7 +658,7 @@ static void btuart_config(dev_link_t *link) | |||
661 | 658 | ||
662 | /* Get configuration register information */ | 659 | /* Get configuration register information */ |
663 | tuple.DesiredTuple = CISTPL_CONFIG; | 660 | tuple.DesiredTuple = CISTPL_CONFIG; |
664 | last_ret = first_tuple(handle, &tuple, &parse); | 661 | last_ret = first_tuple(link, &tuple, &parse); |
665 | if (last_ret != CS_SUCCESS) { | 662 | if (last_ret != CS_SUCCESS) { |
666 | last_fn = ParseTuple; | 663 | last_fn = ParseTuple; |
667 | goto cs_failed; | 664 | goto cs_failed; |
@@ -680,7 +677,7 @@ static void btuart_config(dev_link_t *link) | |||
680 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 677 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
681 | /* Two tries: without IO aliases, then with aliases */ | 678 | /* Two tries: without IO aliases, then with aliases */ |
682 | for (try = 0; try < 2; try++) { | 679 | for (try = 0; try < 2; try++) { |
683 | i = first_tuple(handle, &tuple, &parse); | 680 | i = first_tuple(link, &tuple, &parse); |
684 | while (i != CS_NO_MORE_ITEMS) { | 681 | while (i != CS_NO_MORE_ITEMS) { |
685 | if (i != CS_SUCCESS) | 682 | if (i != CS_SUCCESS) |
686 | goto next_entry; | 683 | goto next_entry; |
@@ -690,19 +687,19 @@ static void btuart_config(dev_link_t *link) | |||
690 | link->conf.ConfigIndex = cf->index; | 687 | link->conf.ConfigIndex = cf->index; |
691 | link->io.BasePort1 = cf->io.win[0].base; | 688 | link->io.BasePort1 = cf->io.win[0].base; |
692 | link->io.IOAddrLines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK; | 689 | link->io.IOAddrLines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK; |
693 | i = pcmcia_request_io(link->handle, &link->io); | 690 | i = pcmcia_request_io(link, &link->io); |
694 | if (i == CS_SUCCESS) | 691 | if (i == CS_SUCCESS) |
695 | goto found_port; | 692 | goto found_port; |
696 | } | 693 | } |
697 | next_entry: | 694 | next_entry: |
698 | i = next_tuple(handle, &tuple, &parse); | 695 | i = next_tuple(link, &tuple, &parse); |
699 | } | 696 | } |
700 | } | 697 | } |
701 | 698 | ||
702 | /* Second pass: try to find an entry that isn't picky about | 699 | /* Second pass: try to find an entry that isn't picky about |
703 | its base address, then try to grab any standard serial port | 700 | its base address, then try to grab any standard serial port |
704 | address, and finally try to get any free port. */ | 701 | address, and finally try to get any free port. */ |
705 | i = first_tuple(handle, &tuple, &parse); | 702 | i = first_tuple(link, &tuple, &parse); |
706 | while (i != CS_NO_MORE_ITEMS) { | 703 | while (i != CS_NO_MORE_ITEMS) { |
707 | if ((i == CS_SUCCESS) && (cf->io.nwin > 0) | 704 | if ((i == CS_SUCCESS) && (cf->io.nwin > 0) |
708 | && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { | 705 | && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { |
@@ -710,30 +707,30 @@ next_entry: | |||
710 | for (j = 0; j < 5; j++) { | 707 | for (j = 0; j < 5; j++) { |
711 | link->io.BasePort1 = base[j]; | 708 | link->io.BasePort1 = base[j]; |
712 | link->io.IOAddrLines = base[j] ? 16 : 3; | 709 | link->io.IOAddrLines = base[j] ? 16 : 3; |
713 | i = pcmcia_request_io(link->handle, &link->io); | 710 | i = pcmcia_request_io(link, &link->io); |
714 | if (i == CS_SUCCESS) | 711 | if (i == CS_SUCCESS) |
715 | goto found_port; | 712 | goto found_port; |
716 | } | 713 | } |
717 | } | 714 | } |
718 | i = next_tuple(handle, &tuple, &parse); | 715 | i = next_tuple(link, &tuple, &parse); |
719 | } | 716 | } |
720 | 717 | ||
721 | found_port: | 718 | found_port: |
722 | if (i != CS_SUCCESS) { | 719 | if (i != CS_SUCCESS) { |
723 | BT_ERR("No usable port range found"); | 720 | BT_ERR("No usable port range found"); |
724 | cs_error(link->handle, RequestIO, i); | 721 | cs_error(link, RequestIO, i); |
725 | goto failed; | 722 | goto failed; |
726 | } | 723 | } |
727 | 724 | ||
728 | i = pcmcia_request_irq(link->handle, &link->irq); | 725 | i = pcmcia_request_irq(link, &link->irq); |
729 | if (i != CS_SUCCESS) { | 726 | if (i != CS_SUCCESS) { |
730 | cs_error(link->handle, RequestIRQ, i); | 727 | cs_error(link, RequestIRQ, i); |
731 | link->irq.AssignedIRQ = 0; | 728 | link->irq.AssignedIRQ = 0; |
732 | } | 729 | } |
733 | 730 | ||
734 | i = pcmcia_request_configuration(link->handle, &link->conf); | 731 | i = pcmcia_request_configuration(link, &link->conf); |
735 | if (i != CS_SUCCESS) { | 732 | if (i != CS_SUCCESS) { |
736 | cs_error(link->handle, RequestConfiguration, i); | 733 | cs_error(link, RequestConfiguration, i); |
737 | goto failed; | 734 | goto failed; |
738 | } | 735 | } |
739 | 736 | ||
@@ -747,21 +744,21 @@ found_port: | |||
747 | return; | 744 | return; |
748 | 745 | ||
749 | cs_failed: | 746 | cs_failed: |
750 | cs_error(link->handle, last_fn, last_ret); | 747 | cs_error(link, last_fn, last_ret); |
751 | 748 | ||
752 | failed: | 749 | failed: |
753 | btuart_release(link); | 750 | btuart_release(link); |
754 | } | 751 | } |
755 | 752 | ||
756 | 753 | ||
757 | static void btuart_release(dev_link_t *link) | 754 | static void btuart_release(struct pcmcia_device *link) |
758 | { | 755 | { |
759 | btuart_info_t *info = link->priv; | 756 | btuart_info_t *info = link->priv; |
760 | 757 | ||
761 | if (link->state & DEV_PRESENT) | 758 | if (link->state & DEV_PRESENT) |
762 | btuart_close(info); | 759 | btuart_close(info); |
763 | 760 | ||
764 | pcmcia_disable_device(link->handle); | 761 | pcmcia_disable_device(link); |
765 | } | 762 | } |
766 | 763 | ||
767 | static struct pcmcia_device_id btuart_ids[] = { | 764 | static struct pcmcia_device_id btuart_ids[] = { |
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 | ||
90 | static void dtl1_config(dev_link_t *link); | 90 | static void dtl1_config(struct pcmcia_device *link); |
91 | static void dtl1_release(dev_link_t *link); | 91 | static void dtl1_release(struct pcmcia_device *link); |
92 | 92 | ||
93 | static void dtl1_detach(struct pcmcia_device *p_dev); | 93 | static 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 | ||
558 | static int dtl1_attach(struct pcmcia_device *p_dev) | 558 | static 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 | ||
589 | static void dtl1_detach(struct pcmcia_device *p_dev) | 588 | static 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 | ||
600 | static int get_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) | 598 | static 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 | ||
611 | static int first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) | 609 | static 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 | ||
618 | static int next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) | 616 | static 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 | ||
625 | static void dtl1_config(dev_link_t *link) | 623 | static 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 | ||
701 | cs_failed: | 698 | cs_failed: |
702 | cs_error(link->handle, last_fn, last_ret); | 699 | cs_error(link, last_fn, last_ret); |
703 | 700 | ||
704 | failed: | 701 | failed: |
705 | dtl1_release(link); | 702 | dtl1_release(link); |
706 | } | 703 | } |
707 | 704 | ||
708 | 705 | ||
709 | static void dtl1_release(dev_link_t *link) | 706 | static 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 | ||