@@ -88,8 +88,8 @@ typedef struct bt3c_info_t {
88
88
} bt3c_info_t ;
89
89
90
90
91
- static void bt3c_config (dev_link_t * link );
92
- static void bt3c_release (dev_link_t * link );
91
+ static void bt3c_config (struct pcmcia_device * link );
92
+ static void bt3c_release (struct pcmcia_device * link );
93
93
94
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
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
650
bt3c_info_t * info ;
651
- dev_link_t * link = dev_to_instance (p_dev );
652
651
653
652
/* Create new info device */
654
653
info = kzalloc (sizeof (* info ), GFP_KERNEL );
655
654
if (!info )
656
655
return - ENOMEM ;
657
656
658
- info -> p_dev = p_dev ;
657
+ info -> p_dev = link ;
659
658
link -> priv = info ;
660
659
661
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
680
bt3c_info_t * info = link -> priv ;
683
681
684
682
if (link -> state & DEV_CONFIG )
@@ -687,7 +685,7 @@ static void bt3c_detach(struct pcmcia_device *p_dev)
687
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
690
int i ;
693
691
@@ -698,24 +696,23 @@ static int get_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
698
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
701
if (pcmcia_get_first_tuple (handle , tuple ) != CS_SUCCESS )
704
702
return CS_NO_MORE_ITEMS ;
705
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
708
if (pcmcia_get_next_tuple (handle , tuple ) != CS_SUCCESS )
711
709
return CS_NO_MORE_ITEMS ;
712
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
715
static kio_addr_t base [5 ] = { 0x3f8 , 0x2f8 , 0x3e8 , 0x2e8 , 0x0 };
718
- client_handle_t handle = link -> handle ;
719
716
bt3c_info_t * info = link -> priv ;
720
717
tuple_t tuple ;
721
718
u_short buf [256 ];
@@ -730,7 +727,7 @@ static void bt3c_config(dev_link_t *link)
730
727
731
728
/* Get configuration register information */
732
729
tuple .DesiredTuple = CISTPL_CONFIG ;
733
- last_ret = first_tuple (handle , & tuple , & parse );
730
+ last_ret = first_tuple (link , & tuple , & parse );
734
731
if (last_ret != CS_SUCCESS ) {
735
732
last_fn = ParseTuple ;
736
733
goto cs_failed ;
@@ -749,7 +746,7 @@ static void bt3c_config(dev_link_t *link)
749
746
tuple .DesiredTuple = CISTPL_CFTABLE_ENTRY ;
750
747
/* Two tries: without IO aliases, then with aliases */
751
748
for (try = 0 ; try < 2 ; try ++ ) {
752
- i = first_tuple (handle , & tuple , & parse );
749
+ i = first_tuple (link , & tuple , & parse );
753
750
while (i != CS_NO_MORE_ITEMS ) {
754
751
if (i != CS_SUCCESS )
755
752
goto next_entry ;
@@ -759,49 +756,49 @@ static void bt3c_config(dev_link_t *link)
759
756
link -> conf .ConfigIndex = cf -> index ;
760
757
link -> io .BasePort1 = cf -> io .win [0 ].base ;
761
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
760
if (i == CS_SUCCESS )
764
761
goto found_port ;
765
762
}
766
763
next_entry :
767
- i = next_tuple (handle , & tuple , & parse );
764
+ i = next_tuple (link , & tuple , & parse );
768
765
}
769
766
}
770
767
771
768
/* Second pass: try to find an entry that isn't picky about
772
769
its base address, then try to grab any standard serial port
773
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
772
while (i != CS_NO_MORE_ITEMS ) {
776
773
if ((i == CS_SUCCESS ) && (cf -> io .nwin > 0 ) && ((cf -> io .flags & CISTPL_IO_LINES_MASK ) <= 3 )) {
777
774
link -> conf .ConfigIndex = cf -> index ;
778
775
for (j = 0 ; j < 5 ; j ++ ) {
779
776
link -> io .BasePort1 = base [j ];
780
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
779
if (i == CS_SUCCESS )
783
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
786
found_port :
790
787
if (i != CS_SUCCESS ) {
791
788
BT_ERR ("No usable port range found" );
792
- cs_error (link -> handle , RequestIO , i );
789
+ cs_error (link , RequestIO , i );
793
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
794
if (i != CS_SUCCESS ) {
798
- cs_error (link -> handle , RequestIRQ , i );
795
+ cs_error (link , RequestIRQ , i );
799
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
800
if (i != CS_SUCCESS ) {
804
- cs_error (link -> handle , RequestConfiguration , i );
801
+ cs_error (link , RequestConfiguration , i );
805
802
goto failed ;
806
803
}
807
804
@@ -815,21 +812,21 @@ static void bt3c_config(dev_link_t *link)
815
812
return ;
816
813
817
814
cs_failed :
818
- cs_error (link -> handle , last_fn , last_ret );
815
+ cs_error (link , last_fn , last_ret );
819
816
820
817
failed :
821
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
824
bt3c_info_t * info = link -> priv ;
828
825
829
826
if (link -> state & DEV_PRESENT )
830
827
bt3c_close (info );
831
828
832
- pcmcia_disable_device (link -> handle );
829
+ pcmcia_disable_device (link );
833
830
}
834
831
835
832
0 commit comments