diff options
Diffstat (limited to 'drivers/scsi/pcmcia')
-rw-r--r-- | drivers/scsi/pcmcia/aha152x_stub.c | 19 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/fdomain_stub.c | 73 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/nsp_cs.c | 21 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/nsp_cs.h | 2 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/qlogic_stub.c | 19 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/sym53c500_cs.c | 19 |
6 files changed, 74 insertions, 79 deletions
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c index 21c6b1014535..7caa700cf189 100644 --- a/drivers/scsi/pcmcia/aha152x_stub.c +++ b/drivers/scsi/pcmcia/aha152x_stub.c | |||
@@ -96,11 +96,11 @@ typedef struct scsi_info_t { | |||
96 | 96 | ||
97 | static void aha152x_release_cs(struct pcmcia_device *link); | 97 | static void aha152x_release_cs(struct pcmcia_device *link); |
98 | static void aha152x_detach(struct pcmcia_device *p_dev); | 98 | static void aha152x_detach(struct pcmcia_device *p_dev); |
99 | static void aha152x_config_cs(struct pcmcia_device *link); | 99 | static int aha152x_config_cs(struct pcmcia_device *link); |
100 | 100 | ||
101 | static struct pcmcia_device *dev_list; | 101 | static struct pcmcia_device *dev_list; |
102 | 102 | ||
103 | static int aha152x_attach(struct pcmcia_device *link) | 103 | static int aha152x_probe(struct pcmcia_device *link) |
104 | { | 104 | { |
105 | scsi_info_t *info; | 105 | scsi_info_t *info; |
106 | 106 | ||
@@ -123,9 +123,7 @@ static int aha152x_attach(struct pcmcia_device *link) | |||
123 | link->conf.Present = PRESENT_OPTION; | 123 | link->conf.Present = PRESENT_OPTION; |
124 | 124 | ||
125 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 125 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
126 | aha152x_config_cs(link); | 126 | return aha152x_config_cs(link); |
127 | |||
128 | return 0; | ||
129 | } /* aha152x_attach */ | 127 | } /* aha152x_attach */ |
130 | 128 | ||
131 | /*====================================================================*/ | 129 | /*====================================================================*/ |
@@ -146,7 +144,7 @@ static void aha152x_detach(struct pcmcia_device *link) | |||
146 | #define CS_CHECK(fn, ret) \ | 144 | #define CS_CHECK(fn, ret) \ |
147 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 145 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
148 | 146 | ||
149 | static void aha152x_config_cs(struct pcmcia_device *link) | 147 | static int aha152x_config_cs(struct pcmcia_device *link) |
150 | { | 148 | { |
151 | scsi_info_t *info = link->priv; | 149 | scsi_info_t *info = link->priv; |
152 | struct aha152x_setup s; | 150 | struct aha152x_setup s; |
@@ -219,12 +217,12 @@ static void aha152x_config_cs(struct pcmcia_device *link) | |||
219 | info->host = host; | 217 | info->host = host; |
220 | 218 | ||
221 | link->state &= ~DEV_CONFIG_PENDING; | 219 | link->state &= ~DEV_CONFIG_PENDING; |
222 | return; | 220 | return 0; |
223 | 221 | ||
224 | cs_failed: | 222 | cs_failed: |
225 | cs_error(link, last_fn, last_ret); | 223 | cs_error(link, last_fn, last_ret); |
226 | aha152x_release_cs(link); | 224 | aha152x_release_cs(link); |
227 | return; | 225 | return -ENODEV; |
228 | } | 226 | } |
229 | 227 | ||
230 | static void aha152x_release_cs(struct pcmcia_device *link) | 228 | static void aha152x_release_cs(struct pcmcia_device *link) |
@@ -259,7 +257,7 @@ static struct pcmcia_driver aha152x_cs_driver = { | |||
259 | .drv = { | 257 | .drv = { |
260 | .name = "aha152x_cs", | 258 | .name = "aha152x_cs", |
261 | }, | 259 | }, |
262 | .probe = aha152x_attach, | 260 | .probe = aha152x_probe, |
263 | .remove = aha152x_detach, | 261 | .remove = aha152x_detach, |
264 | .id_table = aha152x_ids, | 262 | .id_table = aha152x_ids, |
265 | .resume = aha152x_resume, | 263 | .resume = aha152x_resume, |
@@ -278,4 +276,3 @@ static void __exit exit_aha152x_cs(void) | |||
278 | 276 | ||
279 | module_init(init_aha152x_cs); | 277 | module_init(init_aha152x_cs); |
280 | module_exit(exit_aha152x_cs); | 278 | module_exit(exit_aha152x_cs); |
281 | |||
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c index 4e6927112c05..80afd3e879cc 100644 --- a/drivers/scsi/pcmcia/fdomain_stub.c +++ b/drivers/scsi/pcmcia/fdomain_stub.c | |||
@@ -81,33 +81,32 @@ typedef struct scsi_info_t { | |||
81 | 81 | ||
82 | static void fdomain_release(struct pcmcia_device *link); | 82 | static void fdomain_release(struct pcmcia_device *link); |
83 | static void fdomain_detach(struct pcmcia_device *p_dev); | 83 | static void fdomain_detach(struct pcmcia_device *p_dev); |
84 | static void fdomain_config(struct pcmcia_device *link); | 84 | static int fdomain_config(struct pcmcia_device *link); |
85 | 85 | ||
86 | static int fdomain_attach(struct pcmcia_device *link) | 86 | static int fdomain_probe(struct pcmcia_device *link) |
87 | { | 87 | { |
88 | scsi_info_t *info; | 88 | scsi_info_t *info; |
89 | 89 | ||
90 | DEBUG(0, "fdomain_attach()\n"); | 90 | DEBUG(0, "fdomain_attach()\n"); |
91 | 91 | ||
92 | /* Create new SCSI device */ | 92 | /* Create new SCSI device */ |
93 | info = kmalloc(sizeof(*info), GFP_KERNEL); | 93 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
94 | if (!info) return -ENOMEM; | 94 | if (!info) |
95 | memset(info, 0, sizeof(*info)); | 95 | return -ENOMEM; |
96 | info->p_dev = link; | 96 | |
97 | link->priv = info; | 97 | info->p_dev = link; |
98 | link->io.NumPorts1 = 0x10; | 98 | link->priv = info; |
99 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 99 | link->io.NumPorts1 = 0x10; |
100 | link->io.IOAddrLines = 10; | 100 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; |
101 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; | 101 | link->io.IOAddrLines = 10; |
102 | link->irq.IRQInfo1 = IRQ_LEVEL_ID; | 102 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; |
103 | link->conf.Attributes = CONF_ENABLE_IRQ; | 103 | link->irq.IRQInfo1 = IRQ_LEVEL_ID; |
104 | link->conf.IntType = INT_MEMORY_AND_IO; | 104 | link->conf.Attributes = CONF_ENABLE_IRQ; |
105 | link->conf.Present = PRESENT_OPTION; | 105 | link->conf.IntType = INT_MEMORY_AND_IO; |
106 | 106 | link->conf.Present = PRESENT_OPTION; | |
107 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 107 | |
108 | fdomain_config(link); | 108 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
109 | 109 | return fdomain_config(link); | |
110 | return 0; | ||
111 | } /* fdomain_attach */ | 110 | } /* fdomain_attach */ |
112 | 111 | ||
113 | /*====================================================================*/ | 112 | /*====================================================================*/ |
@@ -127,7 +126,7 @@ static void fdomain_detach(struct pcmcia_device *link) | |||
127 | #define CS_CHECK(fn, ret) \ | 126 | #define CS_CHECK(fn, ret) \ |
128 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 127 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
129 | 128 | ||
130 | static void fdomain_config(struct pcmcia_device *link) | 129 | static int fdomain_config(struct pcmcia_device *link) |
131 | { | 130 | { |
132 | scsi_info_t *info = link->priv; | 131 | scsi_info_t *info = link->priv; |
133 | tuple_t tuple; | 132 | tuple_t tuple; |
@@ -150,7 +149,7 @@ static void fdomain_config(struct pcmcia_device *link) | |||
150 | 149 | ||
151 | /* Configure card */ | 150 | /* Configure card */ |
152 | link->state |= DEV_CONFIG; | 151 | link->state |= DEV_CONFIG; |
153 | 152 | ||
154 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 153 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
155 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | 154 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
156 | while (1) { | 155 | while (1) { |
@@ -167,35 +166,35 @@ static void fdomain_config(struct pcmcia_device *link) | |||
167 | 166 | ||
168 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); | 167 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); |
169 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); | 168 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); |
170 | 169 | ||
171 | /* A bad hack... */ | 170 | /* A bad hack... */ |
172 | release_region(link->io.BasePort1, link->io.NumPorts1); | 171 | release_region(link->io.BasePort1, link->io.NumPorts1); |
173 | 172 | ||
174 | /* Set configuration options for the fdomain driver */ | 173 | /* Set configuration options for the fdomain driver */ |
175 | sprintf(str, "%d,%d", link->io.BasePort1, link->irq.AssignedIRQ); | 174 | sprintf(str, "%d,%d", link->io.BasePort1, link->irq.AssignedIRQ); |
176 | fdomain_setup(str); | 175 | fdomain_setup(str); |
177 | 176 | ||
178 | host = __fdomain_16x0_detect(&fdomain_driver_template); | 177 | host = __fdomain_16x0_detect(&fdomain_driver_template); |
179 | if (!host) { | 178 | if (!host) { |
180 | printk(KERN_INFO "fdomain_cs: no SCSI devices found\n"); | 179 | printk(KERN_INFO "fdomain_cs: no SCSI devices found\n"); |
181 | goto cs_failed; | 180 | goto cs_failed; |
182 | } | 181 | } |
183 | 182 | ||
184 | scsi_add_host(host, NULL); /* XXX handle failure */ | 183 | if (scsi_add_host(host, NULL)) |
184 | goto cs_failed; | ||
185 | scsi_scan_host(host); | 185 | scsi_scan_host(host); |
186 | 186 | ||
187 | sprintf(info->node.dev_name, "scsi%d", host->host_no); | 187 | sprintf(info->node.dev_name, "scsi%d", host->host_no); |
188 | link->dev_node = &info->node; | 188 | link->dev_node = &info->node; |
189 | info->host = host; | 189 | info->host = host; |
190 | 190 | ||
191 | link->state &= ~DEV_CONFIG_PENDING; | 191 | link->state &= ~DEV_CONFIG_PENDING; |
192 | return; | 192 | return 0; |
193 | 193 | ||
194 | cs_failed: | 194 | cs_failed: |
195 | cs_error(link, last_fn, last_ret); | 195 | cs_error(link, last_fn, last_ret); |
196 | fdomain_release(link); | 196 | fdomain_release(link); |
197 | return; | 197 | return -ENODEV; |
198 | |||
199 | } /* fdomain_config */ | 198 | } /* fdomain_config */ |
200 | 199 | ||
201 | /*====================================================================*/ | 200 | /*====================================================================*/ |
@@ -234,7 +233,7 @@ static struct pcmcia_driver fdomain_cs_driver = { | |||
234 | .drv = { | 233 | .drv = { |
235 | .name = "fdomain_cs", | 234 | .name = "fdomain_cs", |
236 | }, | 235 | }, |
237 | .probe = fdomain_attach, | 236 | .probe = fdomain_probe, |
238 | .remove = fdomain_detach, | 237 | .remove = fdomain_detach, |
239 | .id_table = fdomain_ids, | 238 | .id_table = fdomain_ids, |
240 | .resume = fdomain_resume, | 239 | .resume = fdomain_resume, |
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c index ce4d7d868d27..deec1c3a2619 100644 --- a/drivers/scsi/pcmcia/nsp_cs.c +++ b/drivers/scsi/pcmcia/nsp_cs.c | |||
@@ -1593,10 +1593,11 @@ static int nsp_eh_host_reset(Scsi_Cmnd *SCpnt) | |||
1593 | configure the card at this point -- we wait until we receive a | 1593 | configure the card at this point -- we wait until we receive a |
1594 | card insertion event. | 1594 | card insertion event. |
1595 | ======================================================================*/ | 1595 | ======================================================================*/ |
1596 | static int nsp_cs_attach(struct pcmcia_device *link) | 1596 | static int nsp_cs_probe(struct pcmcia_device *link) |
1597 | { | 1597 | { |
1598 | scsi_info_t *info; | 1598 | scsi_info_t *info; |
1599 | nsp_hw_data *data = &nsp_data_base; | 1599 | nsp_hw_data *data = &nsp_data_base; |
1600 | int ret; | ||
1600 | 1601 | ||
1601 | nsp_dbg(NSP_DEBUG_INIT, "in"); | 1602 | nsp_dbg(NSP_DEBUG_INIT, "in"); |
1602 | 1603 | ||
@@ -1630,10 +1631,10 @@ static int nsp_cs_attach(struct pcmcia_device *link) | |||
1630 | link->conf.Present = PRESENT_OPTION; | 1631 | link->conf.Present = PRESENT_OPTION; |
1631 | 1632 | ||
1632 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 1633 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
1633 | nsp_cs_config(link); | 1634 | ret = nsp_cs_config(link); |
1634 | 1635 | ||
1635 | nsp_dbg(NSP_DEBUG_INIT, "link=0x%p", link); | 1636 | nsp_dbg(NSP_DEBUG_INIT, "link=0x%p", link); |
1636 | return 0; | 1637 | return ret; |
1637 | } /* nsp_cs_attach */ | 1638 | } /* nsp_cs_attach */ |
1638 | 1639 | ||
1639 | 1640 | ||
@@ -1665,8 +1666,9 @@ static void nsp_cs_detach(struct pcmcia_device *link) | |||
1665 | #define CS_CHECK(fn, ret) \ | 1666 | #define CS_CHECK(fn, ret) \ |
1666 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 1667 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
1667 | /*====================================================================*/ | 1668 | /*====================================================================*/ |
1668 | static void nsp_cs_config(struct pcmcia_device *link) | 1669 | static int nsp_cs_config(struct pcmcia_device *link) |
1669 | { | 1670 | { |
1671 | int ret; | ||
1670 | scsi_info_t *info = link->priv; | 1672 | scsi_info_t *info = link->priv; |
1671 | tuple_t tuple; | 1673 | tuple_t tuple; |
1672 | cisparse_t parse; | 1674 | cisparse_t parse; |
@@ -1842,7 +1844,10 @@ static void nsp_cs_config(struct pcmcia_device *link) | |||
1842 | 1844 | ||
1843 | 1845 | ||
1844 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,74)) | 1846 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,74)) |
1845 | scsi_add_host (host, NULL); | 1847 | ret = scsi_add_host (host, NULL); |
1848 | if (ret) | ||
1849 | goto cs_failed; | ||
1850 | |||
1846 | scsi_scan_host(host); | 1851 | scsi_scan_host(host); |
1847 | 1852 | ||
1848 | snprintf(info->node.dev_name, sizeof(info->node.dev_name), "scsi%d", host->host_no); | 1853 | snprintf(info->node.dev_name, sizeof(info->node.dev_name), "scsi%d", host->host_no); |
@@ -1917,14 +1922,14 @@ static void nsp_cs_config(struct pcmcia_device *link) | |||
1917 | printk("\n"); | 1922 | printk("\n"); |
1918 | 1923 | ||
1919 | link->state &= ~DEV_CONFIG_PENDING; | 1924 | link->state &= ~DEV_CONFIG_PENDING; |
1920 | return; | 1925 | return 0; |
1921 | 1926 | ||
1922 | cs_failed: | 1927 | cs_failed: |
1923 | nsp_dbg(NSP_DEBUG_INIT, "config fail"); | 1928 | nsp_dbg(NSP_DEBUG_INIT, "config fail"); |
1924 | cs_error(link, last_fn, last_ret); | 1929 | cs_error(link, last_fn, last_ret); |
1925 | nsp_cs_release(link); | 1930 | nsp_cs_release(link); |
1926 | 1931 | ||
1927 | return; | 1932 | return -ENODEV; |
1928 | } /* nsp_cs_config */ | 1933 | } /* nsp_cs_config */ |
1929 | #undef CS_CHECK | 1934 | #undef CS_CHECK |
1930 | 1935 | ||
@@ -2033,7 +2038,7 @@ static struct pcmcia_driver nsp_driver = { | |||
2033 | .drv = { | 2038 | .drv = { |
2034 | .name = "nsp_cs", | 2039 | .name = "nsp_cs", |
2035 | }, | 2040 | }, |
2036 | .probe = nsp_cs_attach, | 2041 | .probe = nsp_cs_probe, |
2037 | .remove = nsp_cs_detach, | 2042 | .remove = nsp_cs_detach, |
2038 | .id_table = nsp_cs_ids, | 2043 | .id_table = nsp_cs_ids, |
2039 | .suspend = nsp_cs_suspend, | 2044 | .suspend = nsp_cs_suspend, |
diff --git a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h index ce348b379f22..8908b8e5b78a 100644 --- a/drivers/scsi/pcmcia/nsp_cs.h +++ b/drivers/scsi/pcmcia/nsp_cs.h | |||
@@ -298,7 +298,7 @@ typedef struct _nsp_hw_data { | |||
298 | /* Card service functions */ | 298 | /* Card service functions */ |
299 | static void nsp_cs_detach (struct pcmcia_device *p_dev); | 299 | static void nsp_cs_detach (struct pcmcia_device *p_dev); |
300 | static void nsp_cs_release(struct pcmcia_device *link); | 300 | static void nsp_cs_release(struct pcmcia_device *link); |
301 | static void nsp_cs_config (struct pcmcia_device *link); | 301 | static int nsp_cs_config (struct pcmcia_device *link); |
302 | 302 | ||
303 | /* Linux SCSI subsystem specific functions */ | 303 | /* Linux SCSI subsystem specific functions */ |
304 | static struct Scsi_Host *nsp_detect (struct scsi_host_template *sht); | 304 | static struct Scsi_Host *nsp_detect (struct scsi_host_template *sht); |
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c index a2a1c4b318e6..61c2eb03a9b5 100644 --- a/drivers/scsi/pcmcia/qlogic_stub.c +++ b/drivers/scsi/pcmcia/qlogic_stub.c | |||
@@ -99,7 +99,7 @@ typedef struct scsi_info_t { | |||
99 | 99 | ||
100 | static void qlogic_release(struct pcmcia_device *link); | 100 | static void qlogic_release(struct pcmcia_device *link); |
101 | static void qlogic_detach(struct pcmcia_device *p_dev); | 101 | static void qlogic_detach(struct pcmcia_device *p_dev); |
102 | static void qlogic_config(struct pcmcia_device * link); | 102 | static int qlogic_config(struct pcmcia_device * link); |
103 | 103 | ||
104 | static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host, | 104 | static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host, |
105 | struct pcmcia_device *link, int qbase, int qlirq) | 105 | struct pcmcia_device *link, int qbase, int qlirq) |
@@ -156,7 +156,7 @@ free_scsi_host: | |||
156 | err: | 156 | err: |
157 | return NULL; | 157 | return NULL; |
158 | } | 158 | } |
159 | static int qlogic_attach(struct pcmcia_device *link) | 159 | static int qlogic_probe(struct pcmcia_device *link) |
160 | { | 160 | { |
161 | scsi_info_t *info; | 161 | scsi_info_t *info; |
162 | 162 | ||
@@ -179,9 +179,7 @@ static int qlogic_attach(struct pcmcia_device *link) | |||
179 | link->conf.Present = PRESENT_OPTION; | 179 | link->conf.Present = PRESENT_OPTION; |
180 | 180 | ||
181 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 181 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
182 | qlogic_config(link); | 182 | return qlogic_config(link); |
183 | |||
184 | return 0; | ||
185 | } /* qlogic_attach */ | 183 | } /* qlogic_attach */ |
186 | 184 | ||
187 | /*====================================================================*/ | 185 | /*====================================================================*/ |
@@ -202,7 +200,7 @@ static void qlogic_detach(struct pcmcia_device *link) | |||
202 | #define CS_CHECK(fn, ret) \ | 200 | #define CS_CHECK(fn, ret) \ |
203 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 201 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
204 | 202 | ||
205 | static void qlogic_config(struct pcmcia_device * link) | 203 | static int qlogic_config(struct pcmcia_device * link) |
206 | { | 204 | { |
207 | scsi_info_t *info = link->priv; | 205 | scsi_info_t *info = link->priv; |
208 | tuple_t tuple; | 206 | tuple_t tuple; |
@@ -267,21 +265,20 @@ static void qlogic_config(struct pcmcia_device * link) | |||
267 | 265 | ||
268 | if (!host) { | 266 | if (!host) { |
269 | printk(KERN_INFO "%s: no SCSI devices found\n", qlogic_name); | 267 | printk(KERN_INFO "%s: no SCSI devices found\n", qlogic_name); |
270 | goto out; | 268 | goto cs_failed; |
271 | } | 269 | } |
272 | 270 | ||
273 | sprintf(info->node.dev_name, "scsi%d", host->host_no); | 271 | sprintf(info->node.dev_name, "scsi%d", host->host_no); |
274 | link->dev_node = &info->node; | 272 | link->dev_node = &info->node; |
275 | info->host = host; | 273 | info->host = host; |
276 | 274 | ||
277 | out: | ||
278 | link->state &= ~DEV_CONFIG_PENDING; | 275 | link->state &= ~DEV_CONFIG_PENDING; |
279 | return; | 276 | return 0; |
280 | 277 | ||
281 | cs_failed: | 278 | cs_failed: |
282 | cs_error(link, last_fn, last_ret); | 279 | cs_error(link, last_fn, last_ret); |
283 | pcmcia_disable_device(link); | 280 | pcmcia_disable_device(link); |
284 | return; | 281 | return -ENODEV; |
285 | 282 | ||
286 | } /* qlogic_config */ | 283 | } /* qlogic_config */ |
287 | 284 | ||
@@ -350,7 +347,7 @@ static struct pcmcia_driver qlogic_cs_driver = { | |||
350 | .drv = { | 347 | .drv = { |
351 | .name = "qlogic_cs", | 348 | .name = "qlogic_cs", |
352 | }, | 349 | }, |
353 | .probe = qlogic_attach, | 350 | .probe = qlogic_probe, |
354 | .remove = qlogic_detach, | 351 | .remove = qlogic_detach, |
355 | .id_table = qlogic_ids, | 352 | .id_table = qlogic_ids, |
356 | .resume = qlogic_resume, | 353 | .resume = qlogic_resume, |
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c index 49a37de68758..b4432206a881 100644 --- a/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/drivers/scsi/pcmcia/sym53c500_cs.c | |||
@@ -707,7 +707,7 @@ static struct scsi_host_template sym53c500_driver_template = { | |||
707 | #define CS_CHECK(fn, ret) \ | 707 | #define CS_CHECK(fn, ret) \ |
708 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 708 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
709 | 709 | ||
710 | static void | 710 | static int |
711 | SYM53C500_config(struct pcmcia_device *link) | 711 | SYM53C500_config(struct pcmcia_device *link) |
712 | { | 712 | { |
713 | struct scsi_info_t *info = link->priv; | 713 | struct scsi_info_t *info = link->priv; |
@@ -836,7 +836,8 @@ next_entry: | |||
836 | 836 | ||
837 | scsi_scan_host(host); | 837 | scsi_scan_host(host); |
838 | 838 | ||
839 | goto out; /* SUCCESS */ | 839 | link->state &= ~DEV_CONFIG_PENDING; |
840 | return 0; | ||
840 | 841 | ||
841 | err_free_irq: | 842 | err_free_irq: |
842 | free_irq(irq_level, host); | 843 | free_irq(irq_level, host); |
@@ -845,15 +846,13 @@ err_free_scsi: | |||
845 | err_release: | 846 | err_release: |
846 | release_region(port_base, 0x10); | 847 | release_region(port_base, 0x10); |
847 | printk(KERN_INFO "sym53c500_cs: no SCSI devices found\n"); | 848 | printk(KERN_INFO "sym53c500_cs: no SCSI devices found\n"); |
848 | |||
849 | out: | ||
850 | link->state &= ~DEV_CONFIG_PENDING; | 849 | link->state &= ~DEV_CONFIG_PENDING; |
851 | return; | 850 | return -ENODEV; |
852 | 851 | ||
853 | cs_failed: | 852 | cs_failed: |
854 | cs_error(link, last_fn, last_ret); | 853 | cs_error(link, last_fn, last_ret); |
855 | SYM53C500_release(link); | 854 | SYM53C500_release(link); |
856 | return; | 855 | return -ENODEV; |
857 | } /* SYM53C500_config */ | 856 | } /* SYM53C500_config */ |
858 | 857 | ||
859 | static int sym53c500_resume(struct pcmcia_device *link) | 858 | static int sym53c500_resume(struct pcmcia_device *link) |
@@ -892,7 +891,7 @@ SYM53C500_detach(struct pcmcia_device *link) | |||
892 | } /* SYM53C500_detach */ | 891 | } /* SYM53C500_detach */ |
893 | 892 | ||
894 | static int | 893 | static int |
895 | SYM53C500_attach(struct pcmcia_device *link) | 894 | SYM53C500_probe(struct pcmcia_device *link) |
896 | { | 895 | { |
897 | struct scsi_info_t *info; | 896 | struct scsi_info_t *info; |
898 | 897 | ||
@@ -915,9 +914,7 @@ SYM53C500_attach(struct pcmcia_device *link) | |||
915 | link->conf.Present = PRESENT_OPTION; | 914 | link->conf.Present = PRESENT_OPTION; |
916 | 915 | ||
917 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 916 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
918 | SYM53C500_config(link); | 917 | return SYM53C500_config(link); |
919 | |||
920 | return 0; | ||
921 | } /* SYM53C500_attach */ | 918 | } /* SYM53C500_attach */ |
922 | 919 | ||
923 | MODULE_AUTHOR("Bob Tracy <rct@frus.com>"); | 920 | MODULE_AUTHOR("Bob Tracy <rct@frus.com>"); |
@@ -937,7 +934,7 @@ static struct pcmcia_driver sym53c500_cs_driver = { | |||
937 | .drv = { | 934 | .drv = { |
938 | .name = "sym53c500_cs", | 935 | .name = "sym53c500_cs", |
939 | }, | 936 | }, |
940 | .probe = SYM53C500_attach, | 937 | .probe = SYM53C500_probe, |
941 | .remove = SYM53C500_detach, | 938 | .remove = SYM53C500_detach, |
942 | .id_table = sym53c500_ids, | 939 | .id_table = sym53c500_ids, |
943 | .resume = sym53c500_resume, | 940 | .resume = sym53c500_resume, |