@@ -88,8 +88,8 @@ typedef struct bt3c_info_t {
8888} bt3c_info_t ;
8989
9090
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 );
9393
9494static void bt3c_detach (struct pcmcia_device * p_dev );
9595
@@ -645,17 +645,16 @@ static int bt3c_close(bt3c_info_t *info)
645645 return 0 ;
646646}
647647
648- static int bt3c_attach (struct pcmcia_device * p_dev )
648+ static int bt3c_attach (struct pcmcia_device * link )
649649{
650650 bt3c_info_t * info ;
651- dev_link_t * link = dev_to_instance (p_dev );
652651
653652 /* Create new info device */
654653 info = kzalloc (sizeof (* info ), GFP_KERNEL );
655654 if (!info )
656655 return - ENOMEM ;
657656
658- info -> p_dev = p_dev ;
657+ info -> p_dev = link ;
659658 link -> priv = info ;
660659
661660 link -> io .Attributes1 = IO_DATA_PATH_WIDTH_8 ;
@@ -676,9 +675,8 @@ static int bt3c_attach(struct pcmcia_device *p_dev)
676675}
677676
678677
679- static void bt3c_detach (struct pcmcia_device * p_dev )
678+ static void bt3c_detach (struct pcmcia_device * link )
680679{
681- dev_link_t * link = dev_to_instance (p_dev );
682680 bt3c_info_t * info = link -> priv ;
683681
684682 if (link -> state & DEV_CONFIG )
@@ -687,7 +685,7 @@ static void bt3c_detach(struct pcmcia_device *p_dev)
687685 kfree (info );
688686}
689687
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 )
691689{
692690 int i ;
693691
@@ -698,24 +696,23 @@ static int get_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
698696 return pcmcia_parse_tuple (handle , tuple , parse );
699697}
700698
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 )
702700{
703701 if (pcmcia_get_first_tuple (handle , tuple ) != CS_SUCCESS )
704702 return CS_NO_MORE_ITEMS ;
705703 return get_tuple (handle , tuple , parse );
706704}
707705
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 )
709707{
710708 if (pcmcia_get_next_tuple (handle , tuple ) != CS_SUCCESS )
711709 return CS_NO_MORE_ITEMS ;
712710 return get_tuple (handle , tuple , parse );
713711}
714712
715- static void bt3c_config (dev_link_t * link )
713+ static void bt3c_config (struct pcmcia_device * link )
716714{
717715 static kio_addr_t base [5 ] = { 0x3f8 , 0x2f8 , 0x3e8 , 0x2e8 , 0x0 };
718- client_handle_t handle = link -> handle ;
719716 bt3c_info_t * info = link -> priv ;
720717 tuple_t tuple ;
721718 u_short buf [256 ];
@@ -730,7 +727,7 @@ static void bt3c_config(dev_link_t *link)
730727
731728 /* Get configuration register information */
732729 tuple .DesiredTuple = CISTPL_CONFIG ;
733- last_ret = first_tuple (handle , & tuple , & parse );
730+ last_ret = first_tuple (link , & tuple , & parse );
734731 if (last_ret != CS_SUCCESS ) {
735732 last_fn = ParseTuple ;
736733 goto cs_failed ;
@@ -749,7 +746,7 @@ static void bt3c_config(dev_link_t *link)
749746 tuple .DesiredTuple = CISTPL_CFTABLE_ENTRY ;
750747 /* Two tries: without IO aliases, then with aliases */
751748 for (try = 0 ; try < 2 ; try ++ ) {
752- i = first_tuple (handle , & tuple , & parse );
749+ i = first_tuple (link , & tuple , & parse );
753750 while (i != CS_NO_MORE_ITEMS ) {
754751 if (i != CS_SUCCESS )
755752 goto next_entry ;
@@ -759,49 +756,49 @@ static void bt3c_config(dev_link_t *link)
759756 link -> conf .ConfigIndex = cf -> index ;
760757 link -> io .BasePort1 = cf -> io .win [0 ].base ;
761758 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 );
763760 if (i == CS_SUCCESS )
764761 goto found_port ;
765762 }
766763next_entry :
767- i = next_tuple (handle , & tuple , & parse );
764+ i = next_tuple (link , & tuple , & parse );
768765 }
769766 }
770767
771768 /* Second pass: try to find an entry that isn't picky about
772769 its base address, then try to grab any standard serial port
773770 address, and finally try to get any free port. */
774- i = first_tuple (handle , & tuple , & parse );
771+ i = first_tuple (link , & tuple , & parse );
775772 while (i != CS_NO_MORE_ITEMS ) {
776773 if ((i == CS_SUCCESS ) && (cf -> io .nwin > 0 ) && ((cf -> io .flags & CISTPL_IO_LINES_MASK ) <= 3 )) {
777774 link -> conf .ConfigIndex = cf -> index ;
778775 for (j = 0 ; j < 5 ; j ++ ) {
779776 link -> io .BasePort1 = base [j ];
780777 link -> io .IOAddrLines = base [j ] ? 16 : 3 ;
781- i = pcmcia_request_io (link -> handle , & link -> io );
778+ i = pcmcia_request_io (link , & link -> io );
782779 if (i == CS_SUCCESS )
783780 goto found_port ;
784781 }
785782 }
786- i = next_tuple (handle , & tuple , & parse );
783+ i = next_tuple (link , & tuple , & parse );
787784 }
788785
789786found_port :
790787 if (i != CS_SUCCESS ) {
791788 BT_ERR ("No usable port range found" );
792- cs_error (link -> handle , RequestIO , i );
789+ cs_error (link , RequestIO , i );
793790 goto failed ;
794791 }
795792
796- i = pcmcia_request_irq (link -> handle , & link -> irq );
793+ i = pcmcia_request_irq (link , & link -> irq );
797794 if (i != CS_SUCCESS ) {
798- cs_error (link -> handle , RequestIRQ , i );
795+ cs_error (link , RequestIRQ , i );
799796 link -> irq .AssignedIRQ = 0 ;
800797 }
801798
802- i = pcmcia_request_configuration (link -> handle , & link -> conf );
799+ i = pcmcia_request_configuration (link , & link -> conf );
803800 if (i != CS_SUCCESS ) {
804- cs_error (link -> handle , RequestConfiguration , i );
801+ cs_error (link , RequestConfiguration , i );
805802 goto failed ;
806803 }
807804
@@ -815,21 +812,21 @@ static void bt3c_config(dev_link_t *link)
815812 return ;
816813
817814cs_failed :
818- cs_error (link -> handle , last_fn , last_ret );
815+ cs_error (link , last_fn , last_ret );
819816
820817failed :
821818 bt3c_release (link );
822819}
823820
824821
825- static void bt3c_release (dev_link_t * link )
822+ static void bt3c_release (struct pcmcia_device * link )
826823{
827824 bt3c_info_t * info = link -> priv ;
828825
829826 if (link -> state & DEV_PRESENT )
830827 bt3c_close (info );
831828
832- pcmcia_disable_device (link -> handle );
829+ pcmcia_disable_device (link );
833830}
834831
835832
0 commit comments