aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/fdomain_stub.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/pcmcia/fdomain_stub.c')
-rw-r--r--drivers/scsi/pcmcia/fdomain_stub.c44
1 files changed, 15 insertions, 29 deletions
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
index 06254f46a0dd..914040684079 100644
--- a/drivers/scsi/pcmcia/fdomain_stub.c
+++ b/drivers/scsi/pcmcia/fdomain_stub.c
@@ -59,16 +59,6 @@ MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>");
59MODULE_DESCRIPTION("Future Domain PCMCIA SCSI driver"); 59MODULE_DESCRIPTION("Future Domain PCMCIA SCSI driver");
60MODULE_LICENSE("Dual MPL/GPL"); 60MODULE_LICENSE("Dual MPL/GPL");
61 61
62#ifdef PCMCIA_DEBUG
63static int pc_debug = PCMCIA_DEBUG;
64module_param(pc_debug, int, 0);
65#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
66static char *version =
67"fdomain_cs.c 1.47 2001/10/13 00:08:52 (David Hinds)";
68#else
69#define DEBUG(n, args...)
70#endif
71
72/*====================================================================*/ 62/*====================================================================*/
73 63
74typedef struct scsi_info_t { 64typedef struct scsi_info_t {
@@ -86,7 +76,7 @@ static int fdomain_probe(struct pcmcia_device *link)
86{ 76{
87 scsi_info_t *info; 77 scsi_info_t *info;
88 78
89 DEBUG(0, "fdomain_attach()\n"); 79 dev_dbg(&link->dev, "fdomain_attach()\n");
90 80
91 /* Create new SCSI device */ 81 /* Create new SCSI device */
92 info = kzalloc(sizeof(*info), GFP_KERNEL); 82 info = kzalloc(sizeof(*info), GFP_KERNEL);
@@ -99,7 +89,6 @@ static int fdomain_probe(struct pcmcia_device *link)
99 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 89 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
100 link->io.IOAddrLines = 10; 90 link->io.IOAddrLines = 10;
101 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; 91 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
102 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
103 link->conf.Attributes = CONF_ENABLE_IRQ; 92 link->conf.Attributes = CONF_ENABLE_IRQ;
104 link->conf.IntType = INT_MEMORY_AND_IO; 93 link->conf.IntType = INT_MEMORY_AND_IO;
105 link->conf.Present = PRESENT_OPTION; 94 link->conf.Present = PRESENT_OPTION;
@@ -111,7 +100,7 @@ static int fdomain_probe(struct pcmcia_device *link)
111 100
112static void fdomain_detach(struct pcmcia_device *link) 101static void fdomain_detach(struct pcmcia_device *link)
113{ 102{
114 DEBUG(0, "fdomain_detach(0x%p)\n", link); 103 dev_dbg(&link->dev, "fdomain_detach\n");
115 104
116 fdomain_release(link); 105 fdomain_release(link);
117 106
@@ -120,9 +109,6 @@ static void fdomain_detach(struct pcmcia_device *link)
120 109
121/*====================================================================*/ 110/*====================================================================*/
122 111
123#define CS_CHECK(fn, ret) \
124do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
125
126static int fdomain_config_check(struct pcmcia_device *p_dev, 112static int fdomain_config_check(struct pcmcia_device *p_dev,
127 cistpl_cftable_entry_t *cfg, 113 cistpl_cftable_entry_t *cfg,
128 cistpl_cftable_entry_t *dflt, 114 cistpl_cftable_entry_t *dflt,
@@ -137,20 +123,22 @@ static int fdomain_config_check(struct pcmcia_device *p_dev,
137static int fdomain_config(struct pcmcia_device *link) 123static int fdomain_config(struct pcmcia_device *link)
138{ 124{
139 scsi_info_t *info = link->priv; 125 scsi_info_t *info = link->priv;
140 int last_ret, last_fn; 126 int ret;
141 char str[22]; 127 char str[22];
142 struct Scsi_Host *host; 128 struct Scsi_Host *host;
143 129
144 DEBUG(0, "fdomain_config(0x%p)\n", link); 130 dev_dbg(&link->dev, "fdomain_config\n");
145 131
146 last_ret = pcmcia_loop_config(link, fdomain_config_check, NULL); 132 ret = pcmcia_loop_config(link, fdomain_config_check, NULL);
147 if (last_ret) { 133 if (ret)
148 cs_error(link, RequestIO, last_ret);
149 goto failed; 134 goto failed;
150 }
151 135
152 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 136 ret = pcmcia_request_irq(link, &link->irq);
153 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 137 if (ret)
138 goto failed;
139 ret = pcmcia_request_configuration(link, &link->conf);
140 if (ret)
141 goto failed;
154 142
155 /* A bad hack... */ 143 /* A bad hack... */
156 release_region(link->io.BasePort1, link->io.NumPorts1); 144 release_region(link->io.BasePort1, link->io.NumPorts1);
@@ -162,11 +150,11 @@ static int fdomain_config(struct pcmcia_device *link)
162 host = __fdomain_16x0_detect(&fdomain_driver_template); 150 host = __fdomain_16x0_detect(&fdomain_driver_template);
163 if (!host) { 151 if (!host) {
164 printk(KERN_INFO "fdomain_cs: no SCSI devices found\n"); 152 printk(KERN_INFO "fdomain_cs: no SCSI devices found\n");
165 goto cs_failed; 153 goto failed;
166 } 154 }
167 155
168 if (scsi_add_host(host, NULL)) 156 if (scsi_add_host(host, NULL))
169 goto cs_failed; 157 goto failed;
170 scsi_scan_host(host); 158 scsi_scan_host(host);
171 159
172 sprintf(info->node.dev_name, "scsi%d", host->host_no); 160 sprintf(info->node.dev_name, "scsi%d", host->host_no);
@@ -175,8 +163,6 @@ static int fdomain_config(struct pcmcia_device *link)
175 163
176 return 0; 164 return 0;
177 165
178cs_failed:
179 cs_error(link, last_fn, last_ret);
180failed: 166failed:
181 fdomain_release(link); 167 fdomain_release(link);
182 return -ENODEV; 168 return -ENODEV;
@@ -188,7 +174,7 @@ static void fdomain_release(struct pcmcia_device *link)
188{ 174{
189 scsi_info_t *info = link->priv; 175 scsi_info_t *info = link->priv;
190 176
191 DEBUG(0, "fdomain_release(0x%p)\n", link); 177 dev_dbg(&link->dev, "fdomain_release\n");
192 178
193 scsi_remove_host(info->host); 179 scsi_remove_host(info->host);
194 pcmcia_disable_device(link); 180 pcmcia_disable_device(link);