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/smc91c92_cs.c | |
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/smc91c92_cs.c')
-rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 45 |
1 files changed, 26 insertions, 19 deletions
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 | { |