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.c42
1 files changed, 15 insertions, 27 deletions
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index 67cde0138061..528733b4a392 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);
@@ -115,7 +106,6 @@ static int aha152x_probe(struct pcmcia_device *link)
115 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 106 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
116 link->io.IOAddrLines = 10; 107 link->io.IOAddrLines = 10;
117 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 108 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
118 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
119 link->conf.Attributes = CONF_ENABLE_IRQ; 109 link->conf.Attributes = CONF_ENABLE_IRQ;
120 link->conf.IntType = INT_MEMORY_AND_IO; 110 link->conf.IntType = INT_MEMORY_AND_IO;
121 link->conf.Present = PRESENT_OPTION; 111 link->conf.Present = PRESENT_OPTION;
@@ -127,7 +117,7 @@ static int aha152x_probe(struct pcmcia_device *link)
127 117
128static void aha152x_detach(struct pcmcia_device *link) 118static void aha152x_detach(struct pcmcia_device *link)
129{ 119{
130 DEBUG(0, "aha152x_detach(0x%p)\n", link); 120 dev_dbg(&link->dev, "aha152x_detach\n");
131 121
132 aha152x_release_cs(link); 122 aha152x_release_cs(link);
133 123
@@ -137,9 +127,6 @@ static void aha152x_detach(struct pcmcia_device *link)
137 127
138/*====================================================================*/ 128/*====================================================================*/
139 129
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, 130static int aha152x_config_check(struct pcmcia_device *p_dev,
144 cistpl_cftable_entry_t *cfg, 131 cistpl_cftable_entry_t *cfg,
145 cistpl_cftable_entry_t *dflt, 132 cistpl_cftable_entry_t *dflt,
@@ -164,19 +151,22 @@ static int aha152x_config_cs(struct pcmcia_device *link)
164{ 151{
165 scsi_info_t *info = link->priv; 152 scsi_info_t *info = link->priv;
166 struct aha152x_setup s; 153 struct aha152x_setup s;
167 int last_ret, last_fn; 154 int ret;
168 struct Scsi_Host *host; 155 struct Scsi_Host *host;
169 156
170 DEBUG(0, "aha152x_config(0x%p)\n", link); 157 dev_dbg(&link->dev, "aha152x_config\n");
171 158
172 last_ret = pcmcia_loop_config(link, aha152x_config_check, NULL); 159 ret = pcmcia_loop_config(link, aha152x_config_check, NULL);
173 if (last_ret) { 160 if (ret)
174 cs_error(link, RequestIO, last_ret); 161 goto failed;
175 goto failed;
176 }
177 162
178 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 163 ret = pcmcia_request_irq(link, &link->irq);
179 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 164 if (ret)
165 goto failed;
166
167 ret = pcmcia_request_configuration(link, &link->conf);
168 if (ret)
169 goto failed;
180 170
181 /* Set configuration options for the aha152x driver */ 171 /* Set configuration options for the aha152x driver */
182 memset(&s, 0, sizeof(s)); 172 memset(&s, 0, sizeof(s));
@@ -194,7 +184,7 @@ static int aha152x_config_cs(struct pcmcia_device *link)
194 host = aha152x_probe_one(&s); 184 host = aha152x_probe_one(&s);
195 if (host == NULL) { 185 if (host == NULL) {
196 printk(KERN_INFO "aha152x_cs: no SCSI devices found\n"); 186 printk(KERN_INFO "aha152x_cs: no SCSI devices found\n");
197 goto cs_failed; 187 goto failed;
198 } 188 }
199 189
200 sprintf(info->node.dev_name, "scsi%d", host->host_no); 190 sprintf(info->node.dev_name, "scsi%d", host->host_no);
@@ -203,8 +193,6 @@ static int aha152x_config_cs(struct pcmcia_device *link)
203 193
204 return 0; 194 return 0;
205 195
206cs_failed:
207 cs_error(link, last_fn, last_ret);
208failed: 196failed:
209 aha152x_release_cs(link); 197 aha152x_release_cs(link);
210 return -ENODEV; 198 return -ENODEV;