aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/aha152x_stub.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/pcmcia/aha152x_stub.c')
-rw-r--r--drivers/scsi/pcmcia/aha152x_stub.c41
1 files changed, 15 insertions, 26 deletions
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index 67cde0138061..4329e4e5043d 100644
--- a/drivers/scsi/pcmcia/aha152x_stub.c
+++ b/drivers/scsi/pcmcia/aha152x_stub.c
@@ -54,15 +54,6 @@
54#include <pcmcia/cistpl.h> 54#include <pcmcia/cistpl.h>
55#include <pcmcia/ds.h> 55#include <pcmcia/ds.h>
56 56
57#ifdef PCMCIA_DEBUG
58static int pc_debug = PCMCIA_DEBUG;
59module_param(pc_debug, int, 0644);
60#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
61static char *version =
62"aha152x_cs.c 1.54 2000/06/12 21:27:25 (David Hinds)";
63#else
64#define DEBUG(n, args...)
65#endif
66 57
67/*====================================================================*/ 58/*====================================================================*/
68 59
@@ -103,7 +94,7 @@ static int aha152x_probe(struct pcmcia_device *link)
103{ 94{
104 scsi_info_t *info; 95 scsi_info_t *info;
105 96
106 DEBUG(0, "aha152x_attach()\n"); 97 dev_dbg(&link->dev, "aha152x_attach()\n");
107 98
108 /* Create new SCSI device */ 99 /* Create new SCSI device */
109 info = kzalloc(sizeof(*info), GFP_KERNEL); 100 info = kzalloc(sizeof(*info), GFP_KERNEL);
@@ -127,7 +118,7 @@ static int aha152x_probe(struct pcmcia_device *link)
127 118
128static void aha152x_detach(struct pcmcia_device *link) 119static void aha152x_detach(struct pcmcia_device *link)
129{ 120{
130 DEBUG(0, "aha152x_detach(0x%p)\n", link); 121 dev_dbg(&link->dev, "aha152x_detach\n");
131 122
132 aha152x_release_cs(link); 123 aha152x_release_cs(link);
133 124
@@ -137,9 +128,6 @@ static void aha152x_detach(struct pcmcia_device *link)
137 128
138/*====================================================================*/ 129/*====================================================================*/
139 130
140#define CS_CHECK(fn, ret) \
141do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
142
143static int aha152x_config_check(struct pcmcia_device *p_dev, 131static int aha152x_config_check(struct pcmcia_device *p_dev,
144 cistpl_cftable_entry_t *cfg, 132 cistpl_cftable_entry_t *cfg,
145 cistpl_cftable_entry_t *dflt, 133 cistpl_cftable_entry_t *dflt,
@@ -164,19 +152,22 @@ static int aha152x_config_cs(struct pcmcia_device *link)
164{ 152{
165 scsi_info_t *info = link->priv; 153 scsi_info_t *info = link->priv;
166 struct aha152x_setup s; 154 struct aha152x_setup s;
167 int last_ret, last_fn; 155 int ret;
168 struct Scsi_Host *host; 156 struct Scsi_Host *host;
169 157
170 DEBUG(0, "aha152x_config(0x%p)\n", link); 158 dev_dbg(&link->dev, "aha152x_config\n");
171 159
172 last_ret = pcmcia_loop_config(link, aha152x_config_check, NULL); 160 ret = pcmcia_loop_config(link, aha152x_config_check, NULL);
173 if (last_ret) { 161 if (ret)
174 cs_error(link, RequestIO, last_ret); 162 goto failed;
175 goto failed;
176 }
177 163
178 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 164 ret = pcmcia_request_irq(link, &link->irq);
179 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 165 if (ret)
166 goto failed;
167
168 ret = pcmcia_request_configuration(link, &link->conf);
169 if (ret)
170 goto failed;
180 171
181 /* Set configuration options for the aha152x driver */ 172 /* Set configuration options for the aha152x driver */
182 memset(&s, 0, sizeof(s)); 173 memset(&s, 0, sizeof(s));
@@ -194,7 +185,7 @@ static int aha152x_config_cs(struct pcmcia_device *link)
194 host = aha152x_probe_one(&s); 185 host = aha152x_probe_one(&s);
195 if (host == NULL) { 186 if (host == NULL) {
196 printk(KERN_INFO "aha152x_cs: no SCSI devices found\n"); 187 printk(KERN_INFO "aha152x_cs: no SCSI devices found\n");
197 goto cs_failed; 188 goto failed;
198 } 189 }
199 190
200 sprintf(info->node.dev_name, "scsi%d", host->host_no); 191 sprintf(info->node.dev_name, "scsi%d", host->host_no);
@@ -203,8 +194,6 @@ static int aha152x_config_cs(struct pcmcia_device *link)
203 194
204 return 0; 195 return 0;
205 196
206cs_failed:
207 cs_error(link, last_fn, last_ret);
208failed: 197failed:
209 aha152x_release_cs(link); 198 aha152x_release_cs(link);
210 return -ENODEV; 199 return -ENODEV;