diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2008-08-03 04:07:45 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2008-08-22 20:29:26 -0400 |
commit | 4c89e88bfde6a3c179790e21004f24e09a058290 (patch) | |
tree | 2895a308d64aeabb5fde776d92572a51444d835b /drivers/net/pcmcia | |
parent | 1a53088c101789bfca431de709ff6e45e8c77003 (diff) |
pcmcia: deprecate CS_SUCCESS
Instead of using own error or success codes, the PCMCIA code should rely on
the generic return values. Therefore, replace all occurrences of CS_SUCCESS
with 0.
CC: netdev@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/pcmcia')
-rw-r--r-- | drivers/net/pcmcia/3c574_cs.c | 7 | ||||
-rw-r--r-- | drivers/net/pcmcia/3c589_cs.c | 7 | ||||
-rw-r--r-- | drivers/net/pcmcia/axnet_cs.c | 7 | ||||
-rw-r--r-- | drivers/net/pcmcia/com20020_cs.c | 8 | ||||
-rw-r--r-- | drivers/net/pcmcia/fmvj18x_cs.c | 19 | ||||
-rw-r--r-- | drivers/net/pcmcia/ibmtr_cs.c | 2 | ||||
-rw-r--r-- | drivers/net/pcmcia/pcnet_cs.c | 7 | ||||
-rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 45 |
8 files changed, 57 insertions, 45 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index 7112fd5e0e1b..08c4dd896077 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c | |||
@@ -355,9 +355,10 @@ static int tc574_config(struct pcmcia_device *link) | |||
355 | for (i = j = 0; j < 0x400; j += 0x20) { | 355 | for (i = j = 0; j < 0x400; j += 0x20) { |
356 | link->io.BasePort1 = j ^ 0x300; | 356 | link->io.BasePort1 = j ^ 0x300; |
357 | i = pcmcia_request_io(link, &link->io); | 357 | i = pcmcia_request_io(link, &link->io); |
358 | if (i == CS_SUCCESS) break; | 358 | if (i == 0) |
359 | break; | ||
359 | } | 360 | } |
360 | if (i != CS_SUCCESS) { | 361 | if (i != 0) { |
361 | cs_error(link, RequestIO, i); | 362 | cs_error(link, RequestIO, i); |
362 | goto failed; | 363 | goto failed; |
363 | } | 364 | } |
@@ -377,7 +378,7 @@ static int tc574_config(struct pcmcia_device *link) | |||
377 | tuple.TupleDataMax = 64; | 378 | tuple.TupleDataMax = 64; |
378 | tuple.TupleOffset = 0; | 379 | tuple.TupleOffset = 0; |
379 | tuple.DesiredTuple = 0x88; | 380 | tuple.DesiredTuple = 0x88; |
380 | if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) { | 381 | if (pcmcia_get_first_tuple(link, &tuple) == 0) { |
381 | pcmcia_get_tuple_data(link, &tuple); | 382 | pcmcia_get_tuple_data(link, &tuple); |
382 | for (i = 0; i < 3; i++) | 383 | for (i = 0; i < 3; i++) |
383 | phys_addr[i] = htons(le16_to_cpu(buf[i])); | 384 | phys_addr[i] = htons(le16_to_cpu(buf[i])); |
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index 549a64558420..0b28d0d8ffa8 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c | |||
@@ -278,9 +278,10 @@ static int tc589_config(struct pcmcia_device *link) | |||
278 | if (multi && (j & 0x80)) continue; | 278 | if (multi && (j & 0x80)) continue; |
279 | link->io.BasePort1 = j ^ 0x300; | 279 | link->io.BasePort1 = j ^ 0x300; |
280 | i = pcmcia_request_io(link, &link->io); | 280 | i = pcmcia_request_io(link, &link->io); |
281 | if (i == CS_SUCCESS) break; | 281 | if (i == 0) |
282 | break; | ||
282 | } | 283 | } |
283 | if (i != CS_SUCCESS) { | 284 | if (i != 0) { |
284 | cs_error(link, RequestIO, i); | 285 | cs_error(link, RequestIO, i); |
285 | goto failed; | 286 | goto failed; |
286 | } | 287 | } |
@@ -295,7 +296,7 @@ static int tc589_config(struct pcmcia_device *link) | |||
295 | /* The 3c589 has an extra EEPROM for configuration info, including | 296 | /* The 3c589 has an extra EEPROM for configuration info, including |
296 | the hardware address. The 3c562 puts the address in the CIS. */ | 297 | the hardware address. The 3c562 puts the address in the CIS. */ |
297 | tuple.DesiredTuple = 0x88; | 298 | tuple.DesiredTuple = 0x88; |
298 | if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) { | 299 | if (pcmcia_get_first_tuple(link, &tuple) == 0) { |
299 | pcmcia_get_tuple_data(link, &tuple); | 300 | pcmcia_get_tuple_data(link, &tuple); |
300 | for (i = 0; i < 3; i++) | 301 | for (i = 0; i < 3; i++) |
301 | phys_addr[i] = htons(le16_to_cpu(buf[i])); | 302 | phys_addr[i] = htons(le16_to_cpu(buf[i])); |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 061d889794c5..0bc641adce19 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -262,7 +262,7 @@ static int try_io_port(struct pcmcia_device *link) | |||
262 | if (link->io.NumPorts2 > 0) { | 262 | if (link->io.NumPorts2 > 0) { |
263 | /* for master/slave multifunction cards */ | 263 | /* for master/slave multifunction cards */ |
264 | link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; | 264 | link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; |
265 | link->irq.Attributes = | 265 | link->irq.Attributes = |
266 | IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; | 266 | IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; |
267 | } | 267 | } |
268 | } else { | 268 | } else { |
@@ -276,7 +276,8 @@ static int try_io_port(struct pcmcia_device *link) | |||
276 | link->io.BasePort1 = j ^ 0x300; | 276 | link->io.BasePort1 = j ^ 0x300; |
277 | link->io.BasePort2 = (j ^ 0x300) + 0x10; | 277 | link->io.BasePort2 = (j ^ 0x300) + 0x10; |
278 | ret = pcmcia_request_io(link, &link->io); | 278 | ret = pcmcia_request_io(link, &link->io); |
279 | if (ret == CS_SUCCESS) return ret; | 279 | if (ret == 0) |
280 | return ret; | ||
280 | } | 281 | } |
281 | return ret; | 282 | return ret; |
282 | } else { | 283 | } else { |
@@ -327,7 +328,7 @@ static int axnet_config(struct pcmcia_device *link) | |||
327 | /* don't trust the CIS on this; Linksys got it wrong */ | 328 | /* don't trust the CIS on this; Linksys got it wrong */ |
328 | link->conf.Present = 0x63; | 329 | link->conf.Present = 0x63; |
329 | last_ret = pcmcia_loop_config(link, axnet_configcheck, NULL); | 330 | last_ret = pcmcia_loop_config(link, axnet_configcheck, NULL); |
330 | if (last_ret != CS_SUCCESS) { | 331 | if (last_ret != 0) { |
331 | cs_error(link, RequestIO, last_ret); | 332 | cs_error(link, RequestIO, last_ret); |
332 | goto failed; | 333 | goto failed; |
333 | } | 334 | } |
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c index ea9414c4d900..831090c75622 100644 --- a/drivers/net/pcmcia/com20020_cs.c +++ b/drivers/net/pcmcia/com20020_cs.c | |||
@@ -260,21 +260,21 @@ static int com20020_config(struct pcmcia_device *link) | |||
260 | DEBUG(0, "com20020_config(0x%p)\n", link); | 260 | DEBUG(0, "com20020_config(0x%p)\n", link); |
261 | 261 | ||
262 | DEBUG(1,"arcnet: baseport1 is %Xh\n", link->io.BasePort1); | 262 | DEBUG(1,"arcnet: baseport1 is %Xh\n", link->io.BasePort1); |
263 | i = !CS_SUCCESS; | 263 | i = -ENODEV; |
264 | if (!link->io.BasePort1) | 264 | if (!link->io.BasePort1) |
265 | { | 265 | { |
266 | for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10) | 266 | for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10) |
267 | { | 267 | { |
268 | link->io.BasePort1 = ioaddr; | 268 | link->io.BasePort1 = ioaddr; |
269 | i = pcmcia_request_io(link, &link->io); | 269 | i = pcmcia_request_io(link, &link->io); |
270 | if (i == CS_SUCCESS) | 270 | if (i == 0) |
271 | break; | 271 | break; |
272 | } | 272 | } |
273 | } | 273 | } |
274 | else | 274 | else |
275 | i = pcmcia_request_io(link, &link->io); | 275 | i = pcmcia_request_io(link, &link->io); |
276 | 276 | ||
277 | if (i != CS_SUCCESS) | 277 | if (i != 0) |
278 | { | 278 | { |
279 | DEBUG(1,"arcnet: requestIO failed totally!\n"); | 279 | DEBUG(1,"arcnet: requestIO failed totally!\n"); |
280 | goto failed; | 280 | goto failed; |
@@ -287,7 +287,7 @@ static int com20020_config(struct pcmcia_device *link) | |||
287 | link->irq.AssignedIRQ, | 287 | link->irq.AssignedIRQ, |
288 | link->irq.IRQInfo1, link->irq.IRQInfo2); | 288 | link->irq.IRQInfo1, link->irq.IRQInfo2); |
289 | i = pcmcia_request_irq(link, &link->irq); | 289 | i = pcmcia_request_irq(link, &link->irq); |
290 | if (i != CS_SUCCESS) | 290 | if (i != 0) |
291 | { | 291 | { |
292 | DEBUG(1,"arcnet: requestIRQ failed totally!\n"); | 292 | DEBUG(1,"arcnet: requestIRQ failed totally!\n"); |
293 | goto failed; | 293 | goto failed; |
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index a550c9bd126f..0ffd981502e1 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c | |||
@@ -309,7 +309,8 @@ static int mfc_try_io_port(struct pcmcia_device *link) | |||
309 | printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n"); | 309 | printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n"); |
310 | } | 310 | } |
311 | ret = pcmcia_request_io(link, &link->io); | 311 | ret = pcmcia_request_io(link, &link->io); |
312 | if (ret == CS_SUCCESS) return ret; | 312 | if (ret == 0) |
313 | return ret; | ||
313 | } | 314 | } |
314 | return ret; | 315 | return ret; |
315 | } | 316 | } |
@@ -325,7 +326,7 @@ static int ungermann_try_io_port(struct pcmcia_device *link) | |||
325 | for (ioaddr = 0x300; ioaddr < 0x3e0; ioaddr += 0x20) { | 326 | for (ioaddr = 0x300; ioaddr < 0x3e0; ioaddr += 0x20) { |
326 | link->io.BasePort1 = ioaddr; | 327 | link->io.BasePort1 = ioaddr; |
327 | ret = pcmcia_request_io(link, &link->io); | 328 | ret = pcmcia_request_io(link, &link->io); |
328 | if (ret == CS_SUCCESS) { | 329 | if (ret == 0) { |
329 | /* calculate ConfigIndex value */ | 330 | /* calculate ConfigIndex value */ |
330 | link->conf.ConfigIndex = | 331 | link->conf.ConfigIndex = |
331 | ((link->io.BasePort1 & 0x0f0) >> 3) | 0x22; | 332 | ((link->io.BasePort1 & 0x0f0) >> 3) | 0x22; |
@@ -356,7 +357,7 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
356 | tuple.TupleOffset = 0; | 357 | tuple.TupleOffset = 0; |
357 | tuple.DesiredTuple = CISTPL_FUNCE; | 358 | tuple.DesiredTuple = CISTPL_FUNCE; |
358 | tuple.TupleOffset = 0; | 359 | tuple.TupleOffset = 0; |
359 | if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) { | 360 | if (pcmcia_get_first_tuple(link, &tuple) == 0) { |
360 | /* Yes, I have CISTPL_FUNCE. Let's check CISTPL_MANFID */ | 361 | /* Yes, I have CISTPL_FUNCE. Let's check CISTPL_MANFID */ |
361 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 362 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
362 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | 363 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
@@ -430,10 +431,10 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
430 | link->irq.Attributes = | 431 | link->irq.Attributes = |
431 | IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED|IRQ_HANDLE_PRESENT; | 432 | IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED|IRQ_HANDLE_PRESENT; |
432 | ret = mfc_try_io_port(link); | 433 | ret = mfc_try_io_port(link); |
433 | if (ret != CS_SUCCESS) goto cs_failed; | 434 | if (ret != 0) goto cs_failed; |
434 | } else if (cardtype == UNGERMANN) { | 435 | } else if (cardtype == UNGERMANN) { |
435 | ret = ungermann_try_io_port(link); | 436 | ret = ungermann_try_io_port(link); |
436 | if (ret != CS_SUCCESS) goto cs_failed; | 437 | if (ret != 0) goto cs_failed; |
437 | } else { | 438 | } else { |
438 | CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); | 439 | CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); |
439 | } | 440 | } |
@@ -565,7 +566,7 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) | |||
565 | req.Base = 0; req.Size = 0; | 566 | req.Base = 0; req.Size = 0; |
566 | req.AccessSpeed = 0; | 567 | req.AccessSpeed = 0; |
567 | i = pcmcia_request_window(&link, &req, &link->win); | 568 | i = pcmcia_request_window(&link, &req, &link->win); |
568 | if (i != CS_SUCCESS) { | 569 | if (i != 0) { |
569 | cs_error(link, RequestWindow, i); | 570 | cs_error(link, RequestWindow, i); |
570 | return -1; | 571 | return -1; |
571 | } | 572 | } |
@@ -599,7 +600,7 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) | |||
599 | 600 | ||
600 | iounmap(base); | 601 | iounmap(base); |
601 | j = pcmcia_release_window(link->win); | 602 | j = pcmcia_release_window(link->win); |
602 | if (j != CS_SUCCESS) | 603 | if (j != 0) |
603 | cs_error(link, ReleaseWindow, j); | 604 | cs_error(link, ReleaseWindow, j); |
604 | return (i != 0x200) ? 0 : -1; | 605 | return (i != 0x200) ? 0 : -1; |
605 | 606 | ||
@@ -620,7 +621,7 @@ static int fmvj18x_setup_mfc(struct pcmcia_device *link) | |||
620 | req.Base = 0; req.Size = 0; | 621 | req.Base = 0; req.Size = 0; |
621 | req.AccessSpeed = 0; | 622 | req.AccessSpeed = 0; |
622 | i = pcmcia_request_window(&link, &req, &link->win); | 623 | i = pcmcia_request_window(&link, &req, &link->win); |
623 | if (i != CS_SUCCESS) { | 624 | if (i != 0) { |
624 | cs_error(link, RequestWindow, i); | 625 | cs_error(link, RequestWindow, i); |
625 | return -1; | 626 | return -1; |
626 | } | 627 | } |
@@ -642,7 +643,7 @@ static int fmvj18x_setup_mfc(struct pcmcia_device *link) | |||
642 | 643 | ||
643 | iounmap(base); | 644 | iounmap(base); |
644 | j = pcmcia_release_window(link->win); | 645 | j = pcmcia_release_window(link->win); |
645 | if (j != CS_SUCCESS) | 646 | if (j != 0) |
646 | cs_error(link, ReleaseWindow, j); | 647 | cs_error(link, ReleaseWindow, j); |
647 | return 0; | 648 | return 0; |
648 | 649 | ||
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index 4eafa4f42cff..cf3cca4642f2 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c | |||
@@ -238,7 +238,7 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) | |||
238 | /* Try PRIMARY card at 0xA20-0xA23 */ | 238 | /* Try PRIMARY card at 0xA20-0xA23 */ |
239 | link->io.BasePort1 = 0xA20; | 239 | link->io.BasePort1 = 0xA20; |
240 | i = pcmcia_request_io(link, &link->io); | 240 | i = pcmcia_request_io(link, &link->io); |
241 | if (i != CS_SUCCESS) { | 241 | if (i != 0) { |
242 | /* Couldn't get 0xA20-0xA23. Try ALTERNATE at 0xA24-0xA27. */ | 242 | /* Couldn't get 0xA20-0xA23. Try ALTERNATE at 0xA24-0xA27. */ |
243 | link->io.BasePort1 = 0xA24; | 243 | link->io.BasePort1 = 0xA24; |
244 | CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); | 244 | CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); |
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index aa17434faa0e..1758952b3a38 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -310,7 +310,7 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link) | |||
310 | req.Base = 0; req.Size = 0; | 310 | req.Base = 0; req.Size = 0; |
311 | req.AccessSpeed = 0; | 311 | req.AccessSpeed = 0; |
312 | i = pcmcia_request_window(&link, &req, &link->win); | 312 | i = pcmcia_request_window(&link, &req, &link->win); |
313 | if (i != CS_SUCCESS) { | 313 | if (i != 0) { |
314 | cs_error(link, RequestWindow, i); | 314 | cs_error(link, RequestWindow, i); |
315 | return NULL; | 315 | return NULL; |
316 | } | 316 | } |
@@ -333,7 +333,7 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link) | |||
333 | 333 | ||
334 | iounmap(virt); | 334 | iounmap(virt); |
335 | j = pcmcia_release_window(link->win); | 335 | j = pcmcia_release_window(link->win); |
336 | if (j != CS_SUCCESS) | 336 | if (j != 0) |
337 | cs_error(link, ReleaseWindow, j); | 337 | cs_error(link, ReleaseWindow, j); |
338 | return (i < NR_INFO) ? hw_info+i : NULL; | 338 | return (i < NR_INFO) ? hw_info+i : NULL; |
339 | } /* get_hwinfo */ | 339 | } /* get_hwinfo */ |
@@ -504,7 +504,8 @@ static int try_io_port(struct pcmcia_device *link) | |||
504 | link->io.BasePort1 = j ^ 0x300; | 504 | link->io.BasePort1 = j ^ 0x300; |
505 | link->io.BasePort2 = (j ^ 0x300) + 0x10; | 505 | link->io.BasePort2 = (j ^ 0x300) + 0x10; |
506 | ret = pcmcia_request_io(link, &link->io); | 506 | ret = pcmcia_request_io(link, &link->io); |
507 | if (ret == CS_SUCCESS) return ret; | 507 | if (ret == 0) |
508 | return ret; | ||
508 | } | 509 | } |
509 | return ret; | 510 | return ret; |
510 | } else { | 511 | } else { |
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index b3f2085ddca9..267cbe0afd16 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -409,8 +409,11 @@ static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, | |||
409 | { | 409 | { |
410 | int i; | 410 | int i; |
411 | 411 | ||
412 | if ((i = pcmcia_get_first_tuple(handle, tuple)) != CS_SUCCESS || | 412 | i = pcmcia_get_first_tuple(handle, tuple); |
413 | (i = pcmcia_get_tuple_data(handle, tuple)) != CS_SUCCESS) | 413 | if (i != 0) |
414 | return i; | ||
415 | i = pcmcia_get_tuple_data(handle, tuple); | ||
416 | if (i != 0) | ||
414 | return i; | 417 | return i; |
415 | return pcmcia_parse_tuple(handle, tuple, parse); | 418 | return pcmcia_parse_tuple(handle, tuple, parse); |
416 | } | 419 | } |
@@ -420,8 +423,8 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, | |||
420 | { | 423 | { |
421 | int i; | 424 | int i; |
422 | 425 | ||
423 | if ((i = pcmcia_get_next_tuple(handle, tuple)) != CS_SUCCESS || | 426 | if ((i = pcmcia_get_next_tuple(handle, tuple)) != 0 || |
424 | (i = pcmcia_get_tuple_data(handle, tuple)) != CS_SUCCESS) | 427 | (i = pcmcia_get_tuple_data(handle, tuple)) != 0) |
425 | return i; | 428 | return i; |
426 | return pcmcia_parse_tuple(handle, tuple, parse); | 429 | return pcmcia_parse_tuple(handle, tuple, parse); |
427 | } | 430 | } |
@@ -509,7 +512,7 @@ static int mhz_mfc_config(struct pcmcia_device *link) | |||
509 | req.Base = req.Size = 0; | 512 | req.Base = req.Size = 0; |
510 | req.AccessSpeed = 0; | 513 | req.AccessSpeed = 0; |
511 | i = pcmcia_request_window(&link, &req, &link->win); | 514 | i = pcmcia_request_window(&link, &req, &link->win); |
512 | if (i != CS_SUCCESS) | 515 | if (i != 0) |
513 | goto free_cfg_mem; | 516 | goto free_cfg_mem; |
514 | smc->base = ioremap(req.Base, req.Size); | 517 | smc->base = ioremap(req.Base, req.Size); |
515 | mem.CardOffset = mem.Page = 0; | 518 | mem.CardOffset = mem.Page = 0; |
@@ -517,7 +520,7 @@ static int mhz_mfc_config(struct pcmcia_device *link) | |||
517 | mem.CardOffset = link->conf.ConfigBase; | 520 | mem.CardOffset = link->conf.ConfigBase; |
518 | i = pcmcia_map_mem_page(link->win, &mem); | 521 | i = pcmcia_map_mem_page(link->win, &mem); |
519 | 522 | ||
520 | if ((i == CS_SUCCESS) | 523 | if ((i == 0) |
521 | && (smc->manfid == MANFID_MEGAHERTZ) | 524 | && (smc->manfid == MANFID_MEGAHERTZ) |
522 | && (smc->cardid == PRODID_MEGAHERTZ_EM3288)) | 525 | && (smc->cardid == PRODID_MEGAHERTZ_EM3288)) |
523 | mhz_3288_power(link); | 526 | mhz_3288_power(link); |
@@ -551,12 +554,12 @@ static int mhz_setup(struct pcmcia_device *link) | |||
551 | /* Read the station address from the CIS. It is stored as the last | 554 | /* Read the station address from the CIS. It is stored as the last |
552 | (fourth) string in the Version 1 Version/ID tuple. */ | 555 | (fourth) string in the Version 1 Version/ID tuple. */ |
553 | tuple->DesiredTuple = CISTPL_VERS_1; | 556 | tuple->DesiredTuple = CISTPL_VERS_1; |
554 | if (first_tuple(link, tuple, parse) != CS_SUCCESS) { | 557 | if (first_tuple(link, tuple, parse) != 0) { |
555 | rc = -1; | 558 | rc = -1; |
556 | goto free_cfg_mem; | 559 | goto free_cfg_mem; |
557 | } | 560 | } |
558 | /* Ugh -- the EM1144 card has two VERS_1 tuples!?! */ | 561 | /* Ugh -- the EM1144 card has two VERS_1 tuples!?! */ |
559 | if (next_tuple(link, tuple, parse) != CS_SUCCESS) | 562 | if (next_tuple(link, tuple, parse) != 0) |
560 | first_tuple(link, tuple, parse); | 563 | first_tuple(link, tuple, parse); |
561 | if (parse->version_1.ns > 3) { | 564 | if (parse->version_1.ns > 3) { |
562 | station_addr = parse->version_1.str + parse->version_1.ofs[3]; | 565 | station_addr = parse->version_1.str + parse->version_1.ofs[3]; |
@@ -568,11 +571,11 @@ static int mhz_setup(struct pcmcia_device *link) | |||
568 | 571 | ||
569 | /* Another possibility: for the EM3288, in a special tuple */ | 572 | /* Another possibility: for the EM3288, in a special tuple */ |
570 | tuple->DesiredTuple = 0x81; | 573 | tuple->DesiredTuple = 0x81; |
571 | if (pcmcia_get_first_tuple(link, tuple) != CS_SUCCESS) { | 574 | if (pcmcia_get_first_tuple(link, tuple) != 0) { |
572 | rc = -1; | 575 | rc = -1; |
573 | goto free_cfg_mem; | 576 | goto free_cfg_mem; |
574 | } | 577 | } |
575 | if (pcmcia_get_tuple_data(link, tuple) != CS_SUCCESS) { | 578 | if (pcmcia_get_tuple_data(link, tuple) != 0) { |
576 | rc = -1; | 579 | rc = -1; |
577 | goto free_cfg_mem; | 580 | goto free_cfg_mem; |
578 | } | 581 | } |
@@ -700,12 +703,12 @@ static int smc_setup(struct pcmcia_device *link) | |||
700 | /* Check for a LAN function extension tuple */ | 703 | /* Check for a LAN function extension tuple */ |
701 | tuple->DesiredTuple = CISTPL_FUNCE; | 704 | tuple->DesiredTuple = CISTPL_FUNCE; |
702 | i = first_tuple(link, tuple, parse); | 705 | i = first_tuple(link, tuple, parse); |
703 | while (i == CS_SUCCESS) { | 706 | while (i == 0) { |
704 | if (parse->funce.type == CISTPL_FUNCE_LAN_NODE_ID) | 707 | if (parse->funce.type == CISTPL_FUNCE_LAN_NODE_ID) |
705 | break; | 708 | break; |
706 | i = next_tuple(link, tuple, parse); | 709 | i = next_tuple(link, tuple, parse); |
707 | } | 710 | } |
708 | if (i == CS_SUCCESS) { | 711 | if (i == 0) { |
709 | node_id = (cistpl_lan_node_id_t *)parse->funce.data; | 712 | node_id = (cistpl_lan_node_id_t *)parse->funce.data; |
710 | if (node_id->nb == 6) { | 713 | if (node_id->nb == 6) { |
711 | for (i = 0; i < 6; i++) | 714 | for (i = 0; i < 6; i++) |
@@ -752,9 +755,10 @@ static int osi_config(struct pcmcia_device *link) | |||
752 | for (i = j = 0; j < 4; j++) { | 755 | for (i = j = 0; j < 4; j++) { |
753 | link->io.BasePort2 = com[j]; | 756 | link->io.BasePort2 = com[j]; |
754 | i = pcmcia_request_io(link, &link->io); | 757 | i = pcmcia_request_io(link, &link->io); |
755 | if (i == CS_SUCCESS) break; | 758 | if (i == 0) |
759 | break; | ||
756 | } | 760 | } |
757 | if (i != CS_SUCCESS) { | 761 | if (i != 0) { |
758 | /* Fallback: turn off hard decode */ | 762 | /* Fallback: turn off hard decode */ |
759 | link->conf.ConfigIndex = 0x03; | 763 | link->conf.ConfigIndex = 0x03; |
760 | link->io.NumPorts2 = 0; | 764 | link->io.NumPorts2 = 0; |
@@ -787,13 +791,13 @@ static int osi_setup(struct pcmcia_device *link, u_short manfid, u_short cardid) | |||
787 | /* Read the station address from tuple 0x90, subtuple 0x04 */ | 791 | /* Read the station address from tuple 0x90, subtuple 0x04 */ |
788 | tuple->DesiredTuple = 0x90; | 792 | tuple->DesiredTuple = 0x90; |
789 | i = pcmcia_get_first_tuple(link, tuple); | 793 | i = pcmcia_get_first_tuple(link, tuple); |
790 | while (i == CS_SUCCESS) { | 794 | while (i == 0) { |
791 | i = pcmcia_get_tuple_data(link, tuple); | 795 | i = pcmcia_get_tuple_data(link, tuple); |
792 | if ((i != CS_SUCCESS) || (buf[0] == 0x04)) | 796 | if ((i != 0) || (buf[0] == 0x04)) |
793 | break; | 797 | break; |
794 | i = pcmcia_get_next_tuple(link, tuple); | 798 | i = pcmcia_get_next_tuple(link, tuple); |
795 | } | 799 | } |
796 | if (i != CS_SUCCESS) { | 800 | if (i != 0) { |
797 | rc = -1; | 801 | rc = -1; |
798 | goto free_cfg_mem; | 802 | goto free_cfg_mem; |
799 | } | 803 | } |
@@ -931,8 +935,11 @@ static int check_sig(struct pcmcia_device *link) | |||
931 | 935 | ||
932 | ======================================================================*/ | 936 | ======================================================================*/ |
933 | 937 | ||
934 | #define CS_EXIT_TEST(ret, svc, label) \ | 938 | #define CS_EXIT_TEST(ret, svc, label) \ |
935 | if (ret != CS_SUCCESS) { cs_error(link, svc, ret); goto label; } | 939 | if (ret != 0) { \ |
940 | cs_error(link, svc, ret); \ | ||
941 | goto label; \ | ||
942 | } | ||
936 | 943 | ||
937 | static int smc91c92_config(struct pcmcia_device *link) | 944 | static int smc91c92_config(struct pcmcia_device *link) |
938 | { | 945 | { |