diff options
Diffstat (limited to 'drivers/scsi/pcmcia/sym53c500_cs.c')
-rw-r--r-- | drivers/scsi/pcmcia/sym53c500_cs.c | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c index 1ef3109418c9..49a37de68758 100644 --- a/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/drivers/scsi/pcmcia/sym53c500_cs.c | |||
@@ -527,7 +527,7 @@ idle_out: | |||
527 | } | 527 | } |
528 | 528 | ||
529 | static void | 529 | static void |
530 | SYM53C500_release(dev_link_t *link) | 530 | SYM53C500_release(struct pcmcia_device *link) |
531 | { | 531 | { |
532 | struct scsi_info_t *info = link->priv; | 532 | struct scsi_info_t *info = link->priv; |
533 | struct Scsi_Host *shost = info->host; | 533 | struct Scsi_Host *shost = info->host; |
@@ -550,7 +550,7 @@ SYM53C500_release(dev_link_t *link) | |||
550 | if (shost->io_port && shost->n_io_port) | 550 | if (shost->io_port && shost->n_io_port) |
551 | release_region(shost->io_port, shost->n_io_port); | 551 | release_region(shost->io_port, shost->n_io_port); |
552 | 552 | ||
553 | pcmcia_disable_device(link->handle); | 553 | pcmcia_disable_device(link); |
554 | 554 | ||
555 | scsi_host_put(shost); | 555 | scsi_host_put(shost); |
556 | } /* SYM53C500_release */ | 556 | } /* SYM53C500_release */ |
@@ -708,9 +708,8 @@ static struct scsi_host_template sym53c500_driver_template = { | |||
708 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 708 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
709 | 709 | ||
710 | static void | 710 | static void |
711 | SYM53C500_config(dev_link_t *link) | 711 | SYM53C500_config(struct pcmcia_device *link) |
712 | { | 712 | { |
713 | client_handle_t handle = link->handle; | ||
714 | struct scsi_info_t *info = link->priv; | 713 | struct scsi_info_t *info = link->priv; |
715 | tuple_t tuple; | 714 | tuple_t tuple; |
716 | cisparse_t parse; | 715 | cisparse_t parse; |
@@ -727,40 +726,40 @@ SYM53C500_config(dev_link_t *link) | |||
727 | tuple.TupleDataMax = 64; | 726 | tuple.TupleDataMax = 64; |
728 | tuple.TupleOffset = 0; | 727 | tuple.TupleOffset = 0; |
729 | tuple.DesiredTuple = CISTPL_CONFIG; | 728 | tuple.DesiredTuple = CISTPL_CONFIG; |
730 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); | 729 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
731 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); | 730 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); |
732 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); | 731 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); |
733 | link->conf.ConfigBase = parse.config.base; | 732 | link->conf.ConfigBase = parse.config.base; |
734 | 733 | ||
735 | tuple.DesiredTuple = CISTPL_MANFID; | 734 | tuple.DesiredTuple = CISTPL_MANFID; |
736 | if ((pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) && | 735 | if ((pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) && |
737 | (pcmcia_get_tuple_data(handle, &tuple) == CS_SUCCESS)) | 736 | (pcmcia_get_tuple_data(link, &tuple) == CS_SUCCESS)) |
738 | info->manf_id = le16_to_cpu(tuple.TupleData[0]); | 737 | info->manf_id = le16_to_cpu(tuple.TupleData[0]); |
739 | 738 | ||
740 | /* Configure card */ | 739 | /* Configure card */ |
741 | link->state |= DEV_CONFIG; | 740 | link->state |= DEV_CONFIG; |
742 | 741 | ||
743 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 742 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
744 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); | 743 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
745 | while (1) { | 744 | while (1) { |
746 | if (pcmcia_get_tuple_data(handle, &tuple) != 0 || | 745 | if (pcmcia_get_tuple_data(link, &tuple) != 0 || |
747 | pcmcia_parse_tuple(handle, &tuple, &parse) != 0) | 746 | pcmcia_parse_tuple(link, &tuple, &parse) != 0) |
748 | goto next_entry; | 747 | goto next_entry; |
749 | link->conf.ConfigIndex = parse.cftable_entry.index; | 748 | link->conf.ConfigIndex = parse.cftable_entry.index; |
750 | link->io.BasePort1 = parse.cftable_entry.io.win[0].base; | 749 | link->io.BasePort1 = parse.cftable_entry.io.win[0].base; |
751 | link->io.NumPorts1 = parse.cftable_entry.io.win[0].len; | 750 | link->io.NumPorts1 = parse.cftable_entry.io.win[0].len; |
752 | 751 | ||
753 | if (link->io.BasePort1 != 0) { | 752 | if (link->io.BasePort1 != 0) { |
754 | i = pcmcia_request_io(handle, &link->io); | 753 | i = pcmcia_request_io(link, &link->io); |
755 | if (i == CS_SUCCESS) | 754 | if (i == CS_SUCCESS) |
756 | break; | 755 | break; |
757 | } | 756 | } |
758 | next_entry: | 757 | next_entry: |
759 | CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); | 758 | CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple)); |
760 | } | 759 | } |
761 | 760 | ||
762 | CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq)); | 761 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); |
763 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); | 762 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); |
764 | 763 | ||
765 | /* | 764 | /* |
766 | * That's the trouble with copying liberally from another driver. | 765 | * That's the trouble with copying liberally from another driver. |
@@ -852,14 +851,13 @@ out: | |||
852 | return; | 851 | return; |
853 | 852 | ||
854 | cs_failed: | 853 | cs_failed: |
855 | cs_error(link->handle, last_fn, last_ret); | 854 | cs_error(link, last_fn, last_ret); |
856 | SYM53C500_release(link); | 855 | SYM53C500_release(link); |
857 | return; | 856 | return; |
858 | } /* SYM53C500_config */ | 857 | } /* SYM53C500_config */ |
859 | 858 | ||
860 | static int sym53c500_resume(struct pcmcia_device *dev) | 859 | static int sym53c500_resume(struct pcmcia_device *link) |
861 | { | 860 | { |
862 | dev_link_t *link = dev_to_instance(dev); | ||
863 | struct scsi_info_t *info = link->priv; | 861 | struct scsi_info_t *info = link->priv; |
864 | 862 | ||
865 | if (link->state & DEV_CONFIG) { | 863 | if (link->state & DEV_CONFIG) { |
@@ -882,10 +880,8 @@ static int sym53c500_resume(struct pcmcia_device *dev) | |||
882 | } | 880 | } |
883 | 881 | ||
884 | static void | 882 | static void |
885 | SYM53C500_detach(struct pcmcia_device *p_dev) | 883 | SYM53C500_detach(struct pcmcia_device *link) |
886 | { | 884 | { |
887 | dev_link_t *link = dev_to_instance(p_dev); | ||
888 | |||
889 | DEBUG(0, "SYM53C500_detach(0x%p)\n", link); | 885 | DEBUG(0, "SYM53C500_detach(0x%p)\n", link); |
890 | 886 | ||
891 | if (link->state & DEV_CONFIG) | 887 | if (link->state & DEV_CONFIG) |
@@ -896,10 +892,9 @@ SYM53C500_detach(struct pcmcia_device *p_dev) | |||
896 | } /* SYM53C500_detach */ | 892 | } /* SYM53C500_detach */ |
897 | 893 | ||
898 | static int | 894 | static int |
899 | SYM53C500_attach(struct pcmcia_device *p_dev) | 895 | SYM53C500_attach(struct pcmcia_device *link) |
900 | { | 896 | { |
901 | struct scsi_info_t *info; | 897 | struct scsi_info_t *info; |
902 | dev_link_t *link = dev_to_instance(p_dev); | ||
903 | 898 | ||
904 | DEBUG(0, "SYM53C500_attach()\n"); | 899 | DEBUG(0, "SYM53C500_attach()\n"); |
905 | 900 | ||
@@ -908,7 +903,7 @@ SYM53C500_attach(struct pcmcia_device *p_dev) | |||
908 | if (!info) | 903 | if (!info) |
909 | return -ENOMEM; | 904 | return -ENOMEM; |
910 | memset(info, 0, sizeof(*info)); | 905 | memset(info, 0, sizeof(*info)); |
911 | info->p_dev = p_dev; | 906 | info->p_dev = link; |
912 | link->priv = info; | 907 | link->priv = info; |
913 | link->io.NumPorts1 = 16; | 908 | link->io.NumPorts1 = 16; |
914 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 909 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; |