aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/sym53c500_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/pcmcia/sym53c500_cs.c')
-rw-r--r--drivers/scsi/pcmcia/sym53c500_cs.c41
1 files changed, 14 insertions, 27 deletions
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index b330c11a1752..851a41ce4f06 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
83static int pc_debug = PCMCIA_DEBUG;
84module_param(pc_debug, int, 0);
85#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
86static 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) \
701do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
702
703static int SYM53C500_config_check(struct pcmcia_device *p_dev, 689static 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
719SYM53C500_config(struct pcmcia_device *link) 705SYM53C500_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
827cs_failed:
828 cs_error(link, last_fn, last_ret);
829failed: 816failed:
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)
855static void 842static void
856SYM53C500_detach(struct pcmcia_device *link) 843SYM53C500_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);