diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-05 12:42:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-05 12:42:59 -0500 |
commit | d9b2c4d0b03c721808c0d259e43a27f1e80205bc (patch) | |
tree | f17a4166f62ee14faa1401a6cbd353a4ab8c77cb /drivers/scsi/pcmcia/sym53c500_cs.c | |
parent | 27d16d08717faeaa8afd1b736a096dbaab90f08e (diff) | |
parent | 5fa9167a1bf5f5a4b7282f5e7ac56a4a5a1fa044 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: (50 commits)
pcmcia: rework the irq_req_t typedef
pcmcia: remove deprecated handle_to_dev() macro
pcmcia: pcmcia_request_window() doesn't need a pointer to a pointer
pcmcia: remove unused "window_t" typedef
pcmcia: move some window-related code to pcmcia_ioctl.c
pcmcia: Change window_handle_t logic to unsigned long
pcmcia: Pass struct pcmcia_socket to pcmcia_get_mem_page()
pcmcia: Pass struct pcmcia_device to pcmcia_map_mem_page()
pcmcia: Pass struct pcmcia_device to pcmcia_release_window()
drivers/pcmcia: remove unnecessary kzalloc
pcmcia: correct handling for Zoomed Video registers in topic.h
pcmcia: fix printk formats
pcmcia: autoload module pcmcia
pcmcia/staging: update comedi drivers
PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket
PCMCIA: ss: allow PCI IRQs > 255
PCMCIA: soc_common: remove 'dev' member from soc_pcmcia_socket
PCMCIA: soc_common: constify soc_pcmcia_socket ops member
PCMCIA: sa1111: remove duplicated initializers
PCMCIA: sa1111: wrap soc_pcmcia_socket to contain sa1111 specific data
...
Diffstat (limited to 'drivers/scsi/pcmcia/sym53c500_cs.c')
-rw-r--r-- | drivers/scsi/pcmcia/sym53c500_cs.c | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c index b330c11a1752..e7564d8f0cbf 100644 --- a/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/drivers/scsi/pcmcia/sym53c500_cs.c | |||
@@ -77,17 +77,6 @@ | |||
77 | #include <pcmcia/ds.h> | 77 | #include <pcmcia/ds.h> |
78 | #include <pcmcia/ciscode.h> | 78 | #include <pcmcia/ciscode.h> |
79 | 79 | ||
80 | /* ================================================================== */ | ||
81 | |||
82 | #ifdef PCMCIA_DEBUG | ||
83 | static int pc_debug = PCMCIA_DEBUG; | ||
84 | module_param(pc_debug, int, 0); | ||
85 | #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) | ||
86 | static char *version = | ||
87 | "sym53c500_cs.c 0.9c 2004/10/27 (Bob Tracy)"; | ||
88 | #else | ||
89 | #define DEBUG(n, args...) | ||
90 | #endif | ||
91 | 80 | ||
92 | /* ================================================================== */ | 81 | /* ================================================================== */ |
93 | 82 | ||
@@ -525,7 +514,7 @@ SYM53C500_release(struct pcmcia_device *link) | |||
525 | struct scsi_info_t *info = link->priv; | 514 | struct scsi_info_t *info = link->priv; |
526 | struct Scsi_Host *shost = info->host; | 515 | struct Scsi_Host *shost = info->host; |
527 | 516 | ||
528 | DEBUG(0, "SYM53C500_release(0x%p)\n", link); | 517 | dev_dbg(&link->dev, "SYM53C500_release\n"); |
529 | 518 | ||
530 | /* | 519 | /* |
531 | * Do this before releasing/freeing resources. | 520 | * Do this before releasing/freeing resources. |
@@ -697,9 +686,6 @@ static struct scsi_host_template sym53c500_driver_template = { | |||
697 | .shost_attrs = SYM53C500_shost_attrs | 686 | .shost_attrs = SYM53C500_shost_attrs |
698 | }; | 687 | }; |
699 | 688 | ||
700 | #define CS_CHECK(fn, ret) \ | ||
701 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | ||
702 | |||
703 | static int SYM53C500_config_check(struct pcmcia_device *p_dev, | 689 | static int SYM53C500_config_check(struct pcmcia_device *p_dev, |
704 | cistpl_cftable_entry_t *cfg, | 690 | cistpl_cftable_entry_t *cfg, |
705 | cistpl_cftable_entry_t *dflt, | 691 | cistpl_cftable_entry_t *dflt, |
@@ -719,24 +705,27 @@ static int | |||
719 | SYM53C500_config(struct pcmcia_device *link) | 705 | SYM53C500_config(struct pcmcia_device *link) |
720 | { | 706 | { |
721 | struct scsi_info_t *info = link->priv; | 707 | struct scsi_info_t *info = link->priv; |
722 | int last_ret, last_fn; | 708 | int ret; |
723 | int irq_level, port_base; | 709 | int irq_level, port_base; |
724 | struct Scsi_Host *host; | 710 | struct Scsi_Host *host; |
725 | struct scsi_host_template *tpnt = &sym53c500_driver_template; | 711 | struct scsi_host_template *tpnt = &sym53c500_driver_template; |
726 | struct sym53c500_data *data; | 712 | struct sym53c500_data *data; |
727 | 713 | ||
728 | DEBUG(0, "SYM53C500_config(0x%p)\n", link); | 714 | dev_dbg(&link->dev, "SYM53C500_config\n"); |
729 | 715 | ||
730 | info->manf_id = link->manf_id; | 716 | info->manf_id = link->manf_id; |
731 | 717 | ||
732 | last_ret = pcmcia_loop_config(link, SYM53C500_config_check, NULL); | 718 | ret = pcmcia_loop_config(link, SYM53C500_config_check, NULL); |
733 | if (last_ret) { | 719 | if (ret) |
734 | cs_error(link, RequestIO, last_ret); | 720 | goto failed; |
721 | |||
722 | ret = pcmcia_request_irq(link, &link->irq); | ||
723 | if (ret) | ||
735 | goto failed; | 724 | goto failed; |
736 | } | ||
737 | 725 | ||
738 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); | 726 | ret = pcmcia_request_configuration(link, &link->conf); |
739 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); | 727 | if (ret) |
728 | goto failed; | ||
740 | 729 | ||
741 | /* | 730 | /* |
742 | * That's the trouble with copying liberally from another driver. | 731 | * That's the trouble with copying liberally from another driver. |
@@ -824,8 +813,6 @@ err_release: | |||
824 | printk(KERN_INFO "sym53c500_cs: no SCSI devices found\n"); | 813 | printk(KERN_INFO "sym53c500_cs: no SCSI devices found\n"); |
825 | return -ENODEV; | 814 | return -ENODEV; |
826 | 815 | ||
827 | cs_failed: | ||
828 | cs_error(link, last_fn, last_ret); | ||
829 | failed: | 816 | failed: |
830 | SYM53C500_release(link); | 817 | SYM53C500_release(link); |
831 | return -ENODEV; | 818 | return -ENODEV; |
@@ -855,7 +842,7 @@ static int sym53c500_resume(struct pcmcia_device *link) | |||
855 | static void | 842 | static void |
856 | SYM53C500_detach(struct pcmcia_device *link) | 843 | SYM53C500_detach(struct pcmcia_device *link) |
857 | { | 844 | { |
858 | DEBUG(0, "SYM53C500_detach(0x%p)\n", link); | 845 | dev_dbg(&link->dev, "SYM53C500_detach\n"); |
859 | 846 | ||
860 | SYM53C500_release(link); | 847 | SYM53C500_release(link); |
861 | 848 | ||
@@ -868,7 +855,7 @@ SYM53C500_probe(struct pcmcia_device *link) | |||
868 | { | 855 | { |
869 | struct scsi_info_t *info; | 856 | struct scsi_info_t *info; |
870 | 857 | ||
871 | DEBUG(0, "SYM53C500_attach()\n"); | 858 | dev_dbg(&link->dev, "SYM53C500_attach()\n"); |
872 | 859 | ||
873 | /* Create new SCSI device */ | 860 | /* Create new SCSI device */ |
874 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 861 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
@@ -880,7 +867,6 @@ SYM53C500_probe(struct pcmcia_device *link) | |||
880 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 867 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; |
881 | link->io.IOAddrLines = 10; | 868 | link->io.IOAddrLines = 10; |
882 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; | 869 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; |
883 | link->irq.IRQInfo1 = IRQ_LEVEL_ID; | ||
884 | link->conf.Attributes = CONF_ENABLE_IRQ; | 870 | link->conf.Attributes = CONF_ENABLE_IRQ; |
885 | link->conf.IntType = INT_MEMORY_AND_IO; | 871 | link->conf.IntType = INT_MEMORY_AND_IO; |
886 | 872 | ||