diff options
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/cardbus.c | 2 | ||||
-rw-r--r-- | drivers/pcmcia/cistpl.c | 73 | ||||
-rw-r--r-- | drivers/pcmcia/cs.c | 14 | ||||
-rw-r--r-- | drivers/pcmcia/ds.c | 2 | ||||
-rw-r--r-- | drivers/pcmcia/ds_internal.h | 10 | ||||
-rw-r--r-- | drivers/pcmcia/pcmcia_ioctl.c | 14 | ||||
-rw-r--r-- | drivers/pcmcia/pcmcia_resource.c | 26 | ||||
-rw-r--r-- | drivers/pcmcia/rsrc_nonstatic.c | 4 |
8 files changed, 77 insertions, 68 deletions
diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c index 911ca0e8dfc2..db77e1f3309a 100644 --- a/drivers/pcmcia/cardbus.c +++ b/drivers/pcmcia/cardbus.c | |||
@@ -238,7 +238,7 @@ int __ref cb_alloc(struct pcmcia_socket * s) | |||
238 | pci_bus_add_devices(bus); | 238 | pci_bus_add_devices(bus); |
239 | 239 | ||
240 | s->irq.AssignedIRQ = s->pci_irq; | 240 | s->irq.AssignedIRQ = s->pci_irq; |
241 | return CS_SUCCESS; | 241 | return 0; |
242 | } | 242 | } |
243 | 243 | ||
244 | void cb_free(struct pcmcia_socket * s) | 244 | void cb_free(struct pcmcia_socket * s) |
diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c index fe789e0e7ada..1a513d9a8612 100644 --- a/drivers/pcmcia/cistpl.c +++ b/drivers/pcmcia/cistpl.c | |||
@@ -392,7 +392,7 @@ int pcmcia_replace_cis(struct pcmcia_socket *s, | |||
392 | return CS_OUT_OF_RESOURCE; | 392 | return CS_OUT_OF_RESOURCE; |
393 | s->fake_cis_len = len; | 393 | s->fake_cis_len = len; |
394 | memcpy(s->fake_cis, data, len); | 394 | memcpy(s->fake_cis, data, len); |
395 | return CS_SUCCESS; | 395 | return 0; |
396 | } | 396 | } |
397 | EXPORT_SYMBOL(pcmcia_replace_cis); | 397 | EXPORT_SYMBOL(pcmcia_replace_cis); |
398 | 398 | ||
@@ -441,9 +441,9 @@ int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, tuple | |||
441 | !(tuple->Attributes & TUPLE_RETURN_COMMON)) { | 441 | !(tuple->Attributes & TUPLE_RETURN_COMMON)) { |
442 | cisdata_t req = tuple->DesiredTuple; | 442 | cisdata_t req = tuple->DesiredTuple; |
443 | tuple->DesiredTuple = CISTPL_LONGLINK_MFC; | 443 | tuple->DesiredTuple = CISTPL_LONGLINK_MFC; |
444 | if (pccard_get_next_tuple(s, function, tuple) == CS_SUCCESS) { | 444 | if (pccard_get_next_tuple(s, function, tuple) == 0) { |
445 | tuple->DesiredTuple = CISTPL_LINKTARGET; | 445 | tuple->DesiredTuple = CISTPL_LINKTARGET; |
446 | if (pccard_get_next_tuple(s, function, tuple) != CS_SUCCESS) | 446 | if (pccard_get_next_tuple(s, function, tuple) != 0) |
447 | return CS_NO_MORE_ITEMS; | 447 | return CS_NO_MORE_ITEMS; |
448 | } else | 448 | } else |
449 | tuple->CISOffset = tuple->TupleLink = 0; | 449 | tuple->CISOffset = tuple->TupleLink = 0; |
@@ -584,7 +584,7 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_ | |||
584 | tuple->TupleCode = link[0]; | 584 | tuple->TupleCode = link[0]; |
585 | tuple->TupleLink = link[1]; | 585 | tuple->TupleLink = link[1]; |
586 | tuple->CISOffset = ofs + 2; | 586 | tuple->CISOffset = ofs + 2; |
587 | return CS_SUCCESS; | 587 | return 0; |
588 | } | 588 | } |
589 | EXPORT_SYMBOL(pccard_get_next_tuple); | 589 | EXPORT_SYMBOL(pccard_get_next_tuple); |
590 | 590 | ||
@@ -604,11 +604,11 @@ int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple) | |||
604 | len = tuple->TupleLink - tuple->TupleOffset; | 604 | len = tuple->TupleLink - tuple->TupleOffset; |
605 | tuple->TupleDataLen = tuple->TupleLink; | 605 | tuple->TupleDataLen = tuple->TupleLink; |
606 | if (len == 0) | 606 | if (len == 0) |
607 | return CS_SUCCESS; | 607 | return 0; |
608 | read_cis_cache(s, SPACE(tuple->Flags), | 608 | read_cis_cache(s, SPACE(tuple->Flags), |
609 | tuple->CISOffset + tuple->TupleOffset, | 609 | tuple->CISOffset + tuple->TupleOffset, |
610 | _MIN(len, tuple->TupleDataMax), tuple->TupleData); | 610 | _MIN(len, tuple->TupleDataMax), tuple->TupleData); |
611 | return CS_SUCCESS; | 611 | return 0; |
612 | } | 612 | } |
613 | EXPORT_SYMBOL(pccard_get_tuple_data); | 613 | EXPORT_SYMBOL(pccard_get_tuple_data); |
614 | 614 | ||
@@ -659,7 +659,7 @@ static int parse_device(tuple_t *tuple, cistpl_device_t *device) | |||
659 | if (++p == q) break; | 659 | if (++p == q) break; |
660 | } | 660 | } |
661 | 661 | ||
662 | return CS_SUCCESS; | 662 | return 0; |
663 | } | 663 | } |
664 | 664 | ||
665 | /*====================================================================*/ | 665 | /*====================================================================*/ |
@@ -673,7 +673,7 @@ static int parse_checksum(tuple_t *tuple, cistpl_checksum_t *csum) | |||
673 | csum->addr = tuple->CISOffset + get_unaligned_le16(p) - 2; | 673 | csum->addr = tuple->CISOffset + get_unaligned_le16(p) - 2; |
674 | csum->len = get_unaligned_le16(p + 2); | 674 | csum->len = get_unaligned_le16(p + 2); |
675 | csum->sum = *(p + 4); | 675 | csum->sum = *(p + 4); |
676 | return CS_SUCCESS; | 676 | return 0; |
677 | } | 677 | } |
678 | 678 | ||
679 | /*====================================================================*/ | 679 | /*====================================================================*/ |
@@ -683,7 +683,7 @@ static int parse_longlink(tuple_t *tuple, cistpl_longlink_t *link) | |||
683 | if (tuple->TupleDataLen < 4) | 683 | if (tuple->TupleDataLen < 4) |
684 | return CS_BAD_TUPLE; | 684 | return CS_BAD_TUPLE; |
685 | link->addr = get_unaligned_le32(tuple->TupleData); | 685 | link->addr = get_unaligned_le32(tuple->TupleData); |
686 | return CS_SUCCESS; | 686 | return 0; |
687 | } | 687 | } |
688 | 688 | ||
689 | /*====================================================================*/ | 689 | /*====================================================================*/ |
@@ -704,7 +704,7 @@ static int parse_longlink_mfc(tuple_t *tuple, | |||
704 | link->fn[i].addr = get_unaligned_le32(p); | 704 | link->fn[i].addr = get_unaligned_le32(p); |
705 | p += 4; | 705 | p += 4; |
706 | } | 706 | } |
707 | return CS_SUCCESS; | 707 | return 0; |
708 | } | 708 | } |
709 | 709 | ||
710 | /*====================================================================*/ | 710 | /*====================================================================*/ |
@@ -729,9 +729,9 @@ static int parse_strings(u_char *p, u_char *q, int max, | |||
729 | } | 729 | } |
730 | if (found) { | 730 | if (found) { |
731 | *found = ns; | 731 | *found = ns; |
732 | return CS_SUCCESS; | 732 | return 0; |
733 | } else { | 733 | } else { |
734 | return (ns == max) ? CS_SUCCESS : CS_BAD_TUPLE; | 734 | return (ns == max) ? 0 : CS_BAD_TUPLE; |
735 | } | 735 | } |
736 | } | 736 | } |
737 | 737 | ||
@@ -782,7 +782,7 @@ static int parse_jedec(tuple_t *tuple, cistpl_jedec_t *jedec) | |||
782 | p += 2; | 782 | p += 2; |
783 | } | 783 | } |
784 | jedec->nid = nid; | 784 | jedec->nid = nid; |
785 | return CS_SUCCESS; | 785 | return 0; |
786 | } | 786 | } |
787 | 787 | ||
788 | /*====================================================================*/ | 788 | /*====================================================================*/ |
@@ -793,7 +793,7 @@ static int parse_manfid(tuple_t *tuple, cistpl_manfid_t *m) | |||
793 | return CS_BAD_TUPLE; | 793 | return CS_BAD_TUPLE; |
794 | m->manf = get_unaligned_le16(tuple->TupleData); | 794 | m->manf = get_unaligned_le16(tuple->TupleData); |
795 | m->card = get_unaligned_le16(tuple->TupleData + 2); | 795 | m->card = get_unaligned_le16(tuple->TupleData + 2); |
796 | return CS_SUCCESS; | 796 | return 0; |
797 | } | 797 | } |
798 | 798 | ||
799 | /*====================================================================*/ | 799 | /*====================================================================*/ |
@@ -806,7 +806,7 @@ static int parse_funcid(tuple_t *tuple, cistpl_funcid_t *f) | |||
806 | p = (u_char *)tuple->TupleData; | 806 | p = (u_char *)tuple->TupleData; |
807 | f->func = p[0]; | 807 | f->func = p[0]; |
808 | f->sysinit = p[1]; | 808 | f->sysinit = p[1]; |
809 | return CS_SUCCESS; | 809 | return 0; |
810 | } | 810 | } |
811 | 811 | ||
812 | /*====================================================================*/ | 812 | /*====================================================================*/ |
@@ -821,7 +821,7 @@ static int parse_funce(tuple_t *tuple, cistpl_funce_t *f) | |||
821 | f->type = p[0]; | 821 | f->type = p[0]; |
822 | for (i = 1; i < tuple->TupleDataLen; i++) | 822 | for (i = 1; i < tuple->TupleDataLen; i++) |
823 | f->data[i-1] = p[i]; | 823 | f->data[i-1] = p[i]; |
824 | return CS_SUCCESS; | 824 | return 0; |
825 | } | 825 | } |
826 | 826 | ||
827 | /*====================================================================*/ | 827 | /*====================================================================*/ |
@@ -847,7 +847,7 @@ static int parse_config(tuple_t *tuple, cistpl_config_t *config) | |||
847 | for (i = 0; i <= rmsz; i++) | 847 | for (i = 0; i <= rmsz; i++) |
848 | config->rmask[i>>2] += p[i] << (8*(i%4)); | 848 | config->rmask[i>>2] += p[i] << (8*(i%4)); |
849 | config->subtuples = tuple->TupleDataLen - (rasz+rmsz+4); | 849 | config->subtuples = tuple->TupleDataLen - (rasz+rmsz+4); |
850 | return CS_SUCCESS; | 850 | return 0; |
851 | } | 851 | } |
852 | 852 | ||
853 | /*====================================================================== | 853 | /*====================================================================== |
@@ -1122,7 +1122,7 @@ static int parse_cftable_entry(tuple_t *tuple, | |||
1122 | 1122 | ||
1123 | entry->subtuples = q-p; | 1123 | entry->subtuples = q-p; |
1124 | 1124 | ||
1125 | return CS_SUCCESS; | 1125 | return 0; |
1126 | } | 1126 | } |
1127 | 1127 | ||
1128 | /*====================================================================*/ | 1128 | /*====================================================================*/ |
@@ -1138,7 +1138,7 @@ static int parse_bar(tuple_t *tuple, cistpl_bar_t *bar) | |||
1138 | bar->attr = *p; | 1138 | bar->attr = *p; |
1139 | p += 2; | 1139 | p += 2; |
1140 | bar->size = get_unaligned_le32(p); | 1140 | bar->size = get_unaligned_le32(p); |
1141 | return CS_SUCCESS; | 1141 | return 0; |
1142 | } | 1142 | } |
1143 | 1143 | ||
1144 | static int parse_config_cb(tuple_t *tuple, cistpl_config_t *config) | 1144 | static int parse_config_cb(tuple_t *tuple, cistpl_config_t *config) |
@@ -1152,7 +1152,7 @@ static int parse_config_cb(tuple_t *tuple, cistpl_config_t *config) | |||
1152 | p++; | 1152 | p++; |
1153 | config->base = get_unaligned_le32(p); | 1153 | config->base = get_unaligned_le32(p); |
1154 | config->subtuples = tuple->TupleDataLen - 6; | 1154 | config->subtuples = tuple->TupleDataLen - 6; |
1155 | return CS_SUCCESS; | 1155 | return 0; |
1156 | } | 1156 | } |
1157 | 1157 | ||
1158 | static int parse_cftable_entry_cb(tuple_t *tuple, | 1158 | static int parse_cftable_entry_cb(tuple_t *tuple, |
@@ -1223,7 +1223,7 @@ static int parse_cftable_entry_cb(tuple_t *tuple, | |||
1223 | 1223 | ||
1224 | entry->subtuples = q-p; | 1224 | entry->subtuples = q-p; |
1225 | 1225 | ||
1226 | return CS_SUCCESS; | 1226 | return 0; |
1227 | } | 1227 | } |
1228 | 1228 | ||
1229 | #endif | 1229 | #endif |
@@ -1249,7 +1249,7 @@ static int parse_device_geo(tuple_t *tuple, cistpl_device_geo_t *geo) | |||
1249 | p += 6; | 1249 | p += 6; |
1250 | } | 1250 | } |
1251 | geo->ngeo = n; | 1251 | geo->ngeo = n; |
1252 | return CS_SUCCESS; | 1252 | return 0; |
1253 | } | 1253 | } |
1254 | 1254 | ||
1255 | /*====================================================================*/ | 1255 | /*====================================================================*/ |
@@ -1291,7 +1291,7 @@ static int parse_org(tuple_t *tuple, cistpl_org_t *org) | |||
1291 | if (*p == '\0') break; | 1291 | if (*p == '\0') break; |
1292 | if (++p == q) return CS_BAD_TUPLE; | 1292 | if (++p == q) return CS_BAD_TUPLE; |
1293 | } | 1293 | } |
1294 | return CS_SUCCESS; | 1294 | return 0; |
1295 | } | 1295 | } |
1296 | 1296 | ||
1297 | /*====================================================================*/ | 1297 | /*====================================================================*/ |
@@ -1310,14 +1310,14 @@ static int parse_format(tuple_t *tuple, cistpl_format_t *fmt) | |||
1310 | fmt->offset = get_unaligned_le32(p + 2); | 1310 | fmt->offset = get_unaligned_le32(p + 2); |
1311 | fmt->length = get_unaligned_le32(p + 6); | 1311 | fmt->length = get_unaligned_le32(p + 6); |
1312 | 1312 | ||
1313 | return CS_SUCCESS; | 1313 | return 0; |
1314 | } | 1314 | } |
1315 | 1315 | ||
1316 | /*====================================================================*/ | 1316 | /*====================================================================*/ |
1317 | 1317 | ||
1318 | int pccard_parse_tuple(tuple_t *tuple, cisparse_t *parse) | 1318 | int pccard_parse_tuple(tuple_t *tuple, cisparse_t *parse) |
1319 | { | 1319 | { |
1320 | int ret = CS_SUCCESS; | 1320 | int ret = 0; |
1321 | 1321 | ||
1322 | if (tuple->TupleDataLen > tuple->TupleDataMax) | 1322 | if (tuple->TupleDataLen > tuple->TupleDataMax) |
1323 | return CS_BAD_TUPLE; | 1323 | return CS_BAD_TUPLE; |
@@ -1388,7 +1388,7 @@ int pccard_parse_tuple(tuple_t *tuple, cisparse_t *parse) | |||
1388 | break; | 1388 | break; |
1389 | case CISTPL_NO_LINK: | 1389 | case CISTPL_NO_LINK: |
1390 | case CISTPL_LINKTARGET: | 1390 | case CISTPL_LINKTARGET: |
1391 | ret = CS_SUCCESS; | 1391 | ret = 0; |
1392 | break; | 1392 | break; |
1393 | default: | 1393 | default: |
1394 | ret = CS_UNSUPPORTED_FUNCTION; | 1394 | ret = CS_UNSUPPORTED_FUNCTION; |
@@ -1416,12 +1416,14 @@ int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function, cisdata_t | |||
1416 | tuple.DesiredTuple = code; | 1416 | tuple.DesiredTuple = code; |
1417 | tuple.Attributes = TUPLE_RETURN_COMMON; | 1417 | tuple.Attributes = TUPLE_RETURN_COMMON; |
1418 | ret = pccard_get_first_tuple(s, function, &tuple); | 1418 | ret = pccard_get_first_tuple(s, function, &tuple); |
1419 | if (ret != CS_SUCCESS) goto done; | 1419 | if (ret != 0) |
1420 | goto done; | ||
1420 | tuple.TupleData = buf; | 1421 | tuple.TupleData = buf; |
1421 | tuple.TupleOffset = 0; | 1422 | tuple.TupleOffset = 0; |
1422 | tuple.TupleDataMax = 255; | 1423 | tuple.TupleDataMax = 255; |
1423 | ret = pccard_get_tuple_data(s, &tuple); | 1424 | ret = pccard_get_tuple_data(s, &tuple); |
1424 | if (ret != CS_SUCCESS) goto done; | 1425 | if (ret != 0) |
1426 | goto done; | ||
1425 | ret = pccard_parse_tuple(&tuple, parse); | 1427 | ret = pccard_parse_tuple(&tuple, parse); |
1426 | done: | 1428 | done: |
1427 | kfree(buf); | 1429 | kfree(buf); |
@@ -1462,21 +1464,21 @@ int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, unsigned | |||
1462 | tuple->DesiredTuple = RETURN_FIRST_TUPLE; | 1464 | tuple->DesiredTuple = RETURN_FIRST_TUPLE; |
1463 | tuple->Attributes = TUPLE_RETURN_COMMON; | 1465 | tuple->Attributes = TUPLE_RETURN_COMMON; |
1464 | ret = pccard_get_first_tuple(s, function, tuple); | 1466 | ret = pccard_get_first_tuple(s, function, tuple); |
1465 | if (ret != CS_SUCCESS) | 1467 | if (ret != 0) |
1466 | goto done; | 1468 | goto done; |
1467 | 1469 | ||
1468 | /* First tuple should be DEVICE; we should really have either that | 1470 | /* First tuple should be DEVICE; we should really have either that |
1469 | or a CFTABLE_ENTRY of some sort */ | 1471 | or a CFTABLE_ENTRY of some sort */ |
1470 | if ((tuple->TupleCode == CISTPL_DEVICE) || | 1472 | if ((tuple->TupleCode == CISTPL_DEVICE) || |
1471 | (pccard_read_tuple(s, function, CISTPL_CFTABLE_ENTRY, p) == CS_SUCCESS) || | 1473 | (pccard_read_tuple(s, function, CISTPL_CFTABLE_ENTRY, p) == 0) || |
1472 | (pccard_read_tuple(s, function, CISTPL_CFTABLE_ENTRY_CB, p) == CS_SUCCESS)) | 1474 | (pccard_read_tuple(s, function, CISTPL_CFTABLE_ENTRY_CB, p) == 0)) |
1473 | dev_ok++; | 1475 | dev_ok++; |
1474 | 1476 | ||
1475 | /* All cards should have a MANFID tuple, and/or a VERS_1 or VERS_2 | 1477 | /* All cards should have a MANFID tuple, and/or a VERS_1 or VERS_2 |
1476 | tuple, for card identification. Certain old D-Link and Linksys | 1478 | tuple, for card identification. Certain old D-Link and Linksys |
1477 | cards have only a broken VERS_2 tuple; hence the bogus test. */ | 1479 | cards have only a broken VERS_2 tuple; hence the bogus test. */ |
1478 | if ((pccard_read_tuple(s, function, CISTPL_MANFID, p) == CS_SUCCESS) || | 1480 | if ((pccard_read_tuple(s, function, CISTPL_MANFID, p) == 0) || |
1479 | (pccard_read_tuple(s, function, CISTPL_VERS_1, p) == CS_SUCCESS) || | 1481 | (pccard_read_tuple(s, function, CISTPL_VERS_1, p) == 0) || |
1480 | (pccard_read_tuple(s, function, CISTPL_VERS_2, p) != CS_NO_MORE_ITEMS)) | 1482 | (pccard_read_tuple(s, function, CISTPL_VERS_2, p) != CS_NO_MORE_ITEMS)) |
1481 | ident_ok++; | 1483 | ident_ok++; |
1482 | 1484 | ||
@@ -1485,7 +1487,8 @@ int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, unsigned | |||
1485 | 1487 | ||
1486 | for (count = 1; count < MAX_TUPLES; count++) { | 1488 | for (count = 1; count < MAX_TUPLES; count++) { |
1487 | ret = pccard_get_next_tuple(s, function, tuple); | 1489 | ret = pccard_get_next_tuple(s, function, tuple); |
1488 | if (ret != CS_SUCCESS) break; | 1490 | if (ret != 0) |
1491 | break; | ||
1489 | if (((tuple->TupleCode > 0x23) && (tuple->TupleCode < 0x40)) || | 1492 | if (((tuple->TupleCode > 0x23) && (tuple->TupleCode < 0x40)) || |
1490 | ((tuple->TupleCode > 0x47) && (tuple->TupleCode < 0x80)) || | 1493 | ((tuple->TupleCode > 0x47) && (tuple->TupleCode < 0x80)) || |
1491 | ((tuple->TupleCode > 0x90) && (tuple->TupleCode < 0xff))) | 1494 | ((tuple->TupleCode > 0x90) && (tuple->TupleCode < 0xff))) |
@@ -1500,6 +1503,6 @@ done: | |||
1500 | *info = count; | 1503 | *info = count; |
1501 | kfree(tuple); | 1504 | kfree(tuple); |
1502 | kfree(p); | 1505 | kfree(p); |
1503 | return CS_SUCCESS; | 1506 | return 0; |
1504 | } | 1507 | } |
1505 | EXPORT_SYMBOL(pccard_validate_cis); | 1508 | EXPORT_SYMBOL(pccard_validate_cis); |
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c index ccdbbe4936fd..037cb0c7e094 100644 --- a/drivers/pcmcia/cs.c +++ b/drivers/pcmcia/cs.c | |||
@@ -370,7 +370,7 @@ static int socket_reset(struct pcmcia_socket *skt) | |||
370 | return CS_NO_CARD; | 370 | return CS_NO_CARD; |
371 | 371 | ||
372 | if (status & SS_READY) | 372 | if (status & SS_READY) |
373 | return CS_SUCCESS; | 373 | return 0; |
374 | 374 | ||
375 | msleep(unreset_check * 10); | 375 | msleep(unreset_check * 10); |
376 | } | 376 | } |
@@ -507,7 +507,7 @@ static int socket_insert(struct pcmcia_socket *skt) | |||
507 | return CS_NO_CARD; | 507 | return CS_NO_CARD; |
508 | 508 | ||
509 | ret = socket_setup(skt, setup_delay); | 509 | ret = socket_setup(skt, setup_delay); |
510 | if (ret == CS_SUCCESS) { | 510 | if (ret == 0) { |
511 | skt->state |= SOCKET_PRESENT; | 511 | skt->state |= SOCKET_PRESENT; |
512 | 512 | ||
513 | dev_printk(KERN_NOTICE, &skt->dev, | 513 | dev_printk(KERN_NOTICE, &skt->dev, |
@@ -543,7 +543,7 @@ static int socket_suspend(struct pcmcia_socket *skt) | |||
543 | skt->ops->suspend(skt); | 543 | skt->ops->suspend(skt); |
544 | skt->state |= SOCKET_SUSPEND; | 544 | skt->state |= SOCKET_SUSPEND; |
545 | 545 | ||
546 | return CS_SUCCESS; | 546 | return 0; |
547 | } | 547 | } |
548 | 548 | ||
549 | /* | 549 | /* |
@@ -568,7 +568,7 @@ static int socket_resume(struct pcmcia_socket *skt) | |||
568 | } | 568 | } |
569 | 569 | ||
570 | ret = socket_setup(skt, resume_delay); | 570 | ret = socket_setup(skt, resume_delay); |
571 | if (ret == CS_SUCCESS) { | 571 | if (ret == 0) { |
572 | /* | 572 | /* |
573 | * FIXME: need a better check here for cardbus cards. | 573 | * FIXME: need a better check here for cardbus cards. |
574 | */ | 574 | */ |
@@ -593,7 +593,7 @@ static int socket_resume(struct pcmcia_socket *skt) | |||
593 | 593 | ||
594 | skt->state &= ~SOCKET_SUSPEND; | 594 | skt->state &= ~SOCKET_SUSPEND; |
595 | 595 | ||
596 | return CS_SUCCESS; | 596 | return 0; |
597 | } | 597 | } |
598 | 598 | ||
599 | static void socket_remove(struct pcmcia_socket *skt) | 599 | static void socket_remove(struct pcmcia_socket *skt) |
@@ -778,14 +778,14 @@ int pccard_reset_card(struct pcmcia_socket *skt) | |||
778 | send_event(skt, CS_EVENT_RESET_PHYSICAL, CS_EVENT_PRI_LOW); | 778 | send_event(skt, CS_EVENT_RESET_PHYSICAL, CS_EVENT_PRI_LOW); |
779 | if (skt->callback) | 779 | if (skt->callback) |
780 | skt->callback->suspend(skt); | 780 | skt->callback->suspend(skt); |
781 | if (socket_reset(skt) == CS_SUCCESS) { | 781 | if (socket_reset(skt) == 0) { |
782 | send_event(skt, CS_EVENT_CARD_RESET, CS_EVENT_PRI_LOW); | 782 | send_event(skt, CS_EVENT_CARD_RESET, CS_EVENT_PRI_LOW); |
783 | if (skt->callback) | 783 | if (skt->callback) |
784 | skt->callback->resume(skt); | 784 | skt->callback->resume(skt); |
785 | } | 785 | } |
786 | } | 786 | } |
787 | 787 | ||
788 | ret = CS_SUCCESS; | 788 | ret = 0; |
789 | } while (0); | 789 | } while (0); |
790 | mutex_unlock(&skt->skt_mutex); | 790 | mutex_unlock(&skt->skt_mutex); |
791 | 791 | ||
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index a393501554ac..20bef0c12c14 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -187,7 +187,7 @@ static int pcmcia_report_error(struct pcmcia_device *p_dev, error_info_t *err) | |||
187 | else | 187 | else |
188 | printk("%s: Unknown error code %#x\n", serv, err->retcode); | 188 | printk("%s: Unknown error code %#x\n", serv, err->retcode); |
189 | 189 | ||
190 | return CS_SUCCESS; | 190 | return 0; |
191 | } /* report_error */ | 191 | } /* report_error */ |
192 | 192 | ||
193 | /* end of code which was in cs.c before */ | 193 | /* end of code which was in cs.c before */ |
diff --git a/drivers/pcmcia/ds_internal.h b/drivers/pcmcia/ds_internal.h index 3a2b25e6ed73..14bc55aa1426 100644 --- a/drivers/pcmcia/ds_internal.h +++ b/drivers/pcmcia/ds_internal.h | |||
@@ -18,6 +18,12 @@ extern int handle_request(struct pcmcia_socket *s, event_t event); | |||
18 | #else | 18 | #else |
19 | static inline void __init pcmcia_setup_ioctl(void) { return; } | 19 | static inline void __init pcmcia_setup_ioctl(void) { return; } |
20 | static inline void __exit pcmcia_cleanup_ioctl(void) { return; } | 20 | static inline void __exit pcmcia_cleanup_ioctl(void) { return; } |
21 | static inline void handle_event(struct pcmcia_socket *s, event_t event) { return; } | 21 | static inline void handle_event(struct pcmcia_socket *s, event_t event) |
22 | static inline int handle_request(struct pcmcia_socket *s, event_t event) { return CS_SUCCESS; } | 22 | { |
23 | return; | ||
24 | } | ||
25 | static inline int handle_request(struct pcmcia_socket *s, event_t event) | ||
26 | { | ||
27 | return 0; | ||
28 | } | ||
23 | #endif | 29 | #endif |
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c index 53dadc111002..ef64ceb5e751 100644 --- a/drivers/pcmcia/pcmcia_ioctl.c +++ b/drivers/pcmcia/pcmcia_ioctl.c | |||
@@ -167,7 +167,7 @@ static int adjust_irq(struct pcmcia_socket *s, adjust_t *adj) | |||
167 | #else | 167 | #else |
168 | 168 | ||
169 | static inline int adjust_irq(struct pcmcia_socket *s, adjust_t *adj) { | 169 | static inline int adjust_irq(struct pcmcia_socket *s, adjust_t *adj) { |
170 | return CS_SUCCESS; | 170 | return 0; |
171 | } | 171 | } |
172 | 172 | ||
173 | #endif | 173 | #endif |
@@ -274,7 +274,7 @@ static int pccard_get_status(struct pcmcia_socket *s, | |||
274 | status->CardState |= | 274 | status->CardState |= |
275 | (reg & ESR_REQ_ATTN) ? CS_EVENT_REQUEST_ATTENTION : 0; | 275 | (reg & ESR_REQ_ATTN) ? CS_EVENT_REQUEST_ATTENTION : 0; |
276 | } | 276 | } |
277 | return CS_SUCCESS; | 277 | return 0; |
278 | } | 278 | } |
279 | status->CardState |= | 279 | status->CardState |= |
280 | (val & SS_WRPROT) ? CS_EVENT_WRITE_PROTECT : 0; | 280 | (val & SS_WRPROT) ? CS_EVENT_WRITE_PROTECT : 0; |
@@ -284,7 +284,7 @@ static int pccard_get_status(struct pcmcia_socket *s, | |||
284 | (val & SS_BATWARN) ? CS_EVENT_BATTERY_LOW : 0; | 284 | (val & SS_BATWARN) ? CS_EVENT_BATTERY_LOW : 0; |
285 | status->CardState |= | 285 | status->CardState |= |
286 | (val & SS_READY) ? CS_EVENT_READY_CHANGE : 0; | 286 | (val & SS_READY) ? CS_EVENT_READY_CHANGE : 0; |
287 | return CS_SUCCESS; | 287 | return 0; |
288 | } /* pccard_get_status */ | 288 | } /* pccard_get_status */ |
289 | 289 | ||
290 | int pccard_get_configuration_info(struct pcmcia_socket *s, | 290 | int pccard_get_configuration_info(struct pcmcia_socket *s, |
@@ -315,7 +315,7 @@ int pccard_get_configuration_info(struct pcmcia_socket *s, | |||
315 | config->BasePort1 + 1; | 315 | config->BasePort1 + 1; |
316 | } | 316 | } |
317 | } | 317 | } |
318 | return CS_SUCCESS; | 318 | return 0; |
319 | } | 319 | } |
320 | #endif | 320 | #endif |
321 | 321 | ||
@@ -331,7 +331,7 @@ int pccard_get_configuration_info(struct pcmcia_socket *s, | |||
331 | config->Attributes = 0; | 331 | config->Attributes = 0; |
332 | config->Vcc = s->socket.Vcc; | 332 | config->Vcc = s->socket.Vcc; |
333 | config->Vpp1 = config->Vpp2 = s->socket.Vpp; | 333 | config->Vpp1 = config->Vpp2 = s->socket.Vpp; |
334 | return CS_SUCCESS; | 334 | return 0; |
335 | } | 335 | } |
336 | 336 | ||
337 | config->Attributes = c->Attributes | CONF_VALID_CLIENT; | 337 | config->Attributes = c->Attributes | CONF_VALID_CLIENT; |
@@ -355,7 +355,7 @@ int pccard_get_configuration_info(struct pcmcia_socket *s, | |||
355 | config->Attributes2 = c->io.Attributes2; | 355 | config->Attributes2 = c->io.Attributes2; |
356 | config->IOAddrLines = c->io.IOAddrLines; | 356 | config->IOAddrLines = c->io.IOAddrLines; |
357 | 357 | ||
358 | return CS_SUCCESS; | 358 | return 0; |
359 | } /* pccard_get_configuration_info */ | 359 | } /* pccard_get_configuration_info */ |
360 | 360 | ||
361 | 361 | ||
@@ -961,7 +961,7 @@ static int ds_ioctl(struct inode * inode, struct file * file, | |||
961 | err = -EINVAL; | 961 | err = -EINVAL; |
962 | } | 962 | } |
963 | 963 | ||
964 | if ((err == 0) && (ret != CS_SUCCESS)) { | 964 | if ((err == 0) && (ret != 0)) { |
965 | ds_dbg(2, "ds_ioctl: ret = %d\n", ret); | 965 | ds_dbg(2, "ds_ioctl: ret = %d\n", ret); |
966 | switch (ret) { | 966 | switch (ret) { |
967 | case CS_BAD_SOCKET: case CS_NO_CARD: | 967 | case CS_BAD_SOCKET: case CS_NO_CARD: |
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index c5a2b005091c..48e168e8165b 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c | |||
@@ -192,7 +192,7 @@ int pcmcia_access_configuration_register(struct pcmcia_device *p_dev, | |||
192 | return CS_BAD_ARGS; | 192 | return CS_BAD_ARGS; |
193 | break; | 193 | break; |
194 | } | 194 | } |
195 | return CS_SUCCESS; | 195 | return 0; |
196 | } /* pcmcia_access_configuration_register */ | 196 | } /* pcmcia_access_configuration_register */ |
197 | EXPORT_SYMBOL(pcmcia_access_configuration_register); | 197 | EXPORT_SYMBOL(pcmcia_access_configuration_register); |
198 | 198 | ||
@@ -226,7 +226,7 @@ int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *handle, | |||
226 | if (win->ctl.flags & MAP_USE_WAIT) | 226 | if (win->ctl.flags & MAP_USE_WAIT) |
227 | req->Attributes |= WIN_USE_WAIT; | 227 | req->Attributes |= WIN_USE_WAIT; |
228 | *handle = win; | 228 | *handle = win; |
229 | return CS_SUCCESS; | 229 | return 0; |
230 | } /* pcmcia_get_window */ | 230 | } /* pcmcia_get_window */ |
231 | EXPORT_SYMBOL(pcmcia_get_window); | 231 | EXPORT_SYMBOL(pcmcia_get_window); |
232 | 232 | ||
@@ -241,7 +241,7 @@ int pcmcia_get_mem_page(window_handle_t win, memreq_t *req) | |||
241 | return CS_BAD_HANDLE; | 241 | return CS_BAD_HANDLE; |
242 | req->Page = 0; | 242 | req->Page = 0; |
243 | req->CardOffset = win->ctl.card_start; | 243 | req->CardOffset = win->ctl.card_start; |
244 | return CS_SUCCESS; | 244 | return 0; |
245 | } /* pcmcia_get_mem_page */ | 245 | } /* pcmcia_get_mem_page */ |
246 | EXPORT_SYMBOL(pcmcia_get_mem_page); | 246 | EXPORT_SYMBOL(pcmcia_get_mem_page); |
247 | 247 | ||
@@ -257,7 +257,7 @@ int pcmcia_map_mem_page(window_handle_t win, memreq_t *req) | |||
257 | win->ctl.card_start = req->CardOffset; | 257 | win->ctl.card_start = req->CardOffset; |
258 | if (s->ops->set_mem_map(s, &win->ctl) != 0) | 258 | if (s->ops->set_mem_map(s, &win->ctl) != 0) |
259 | return CS_BAD_OFFSET; | 259 | return CS_BAD_OFFSET; |
260 | return CS_SUCCESS; | 260 | return 0; |
261 | } /* pcmcia_map_mem_page */ | 261 | } /* pcmcia_map_mem_page */ |
262 | EXPORT_SYMBOL(pcmcia_map_mem_page); | 262 | EXPORT_SYMBOL(pcmcia_map_mem_page); |
263 | 263 | ||
@@ -328,7 +328,7 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev, | |||
328 | } | 328 | } |
329 | } | 329 | } |
330 | 330 | ||
331 | return CS_SUCCESS; | 331 | return 0; |
332 | } /* modify_configuration */ | 332 | } /* modify_configuration */ |
333 | EXPORT_SYMBOL(pcmcia_modify_configuration); | 333 | EXPORT_SYMBOL(pcmcia_modify_configuration); |
334 | 334 | ||
@@ -363,7 +363,7 @@ int pcmcia_release_configuration(struct pcmcia_device *p_dev) | |||
363 | } | 363 | } |
364 | } | 364 | } |
365 | 365 | ||
366 | return CS_SUCCESS; | 366 | return 0; |
367 | } /* pcmcia_release_configuration */ | 367 | } /* pcmcia_release_configuration */ |
368 | 368 | ||
369 | 369 | ||
@@ -397,7 +397,7 @@ static int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req) | |||
397 | if (req->NumPorts2) | 397 | if (req->NumPorts2) |
398 | release_io_space(s, req->BasePort2, req->NumPorts2); | 398 | release_io_space(s, req->BasePort2, req->NumPorts2); |
399 | 399 | ||
400 | return CS_SUCCESS; | 400 | return 0; |
401 | } /* pcmcia_release_io */ | 401 | } /* pcmcia_release_io */ |
402 | 402 | ||
403 | 403 | ||
@@ -429,7 +429,7 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req) | |||
429 | pcmcia_used_irq[req->AssignedIRQ]--; | 429 | pcmcia_used_irq[req->AssignedIRQ]--; |
430 | #endif | 430 | #endif |
431 | 431 | ||
432 | return CS_SUCCESS; | 432 | return 0; |
433 | } /* pcmcia_release_irq */ | 433 | } /* pcmcia_release_irq */ |
434 | 434 | ||
435 | 435 | ||
@@ -458,7 +458,7 @@ int pcmcia_release_window(window_handle_t win) | |||
458 | 458 | ||
459 | win->magic = 0; | 459 | win->magic = 0; |
460 | 460 | ||
461 | return CS_SUCCESS; | 461 | return 0; |
462 | } /* pcmcia_release_window */ | 462 | } /* pcmcia_release_window */ |
463 | EXPORT_SYMBOL(pcmcia_release_window); | 463 | EXPORT_SYMBOL(pcmcia_release_window); |
464 | 464 | ||
@@ -573,7 +573,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, | |||
573 | 573 | ||
574 | c->state |= CONFIG_LOCKED; | 574 | c->state |= CONFIG_LOCKED; |
575 | p_dev->_locked = 1; | 575 | p_dev->_locked = 1; |
576 | return CS_SUCCESS; | 576 | return 0; |
577 | } /* pcmcia_request_configuration */ | 577 | } /* pcmcia_request_configuration */ |
578 | EXPORT_SYMBOL(pcmcia_request_configuration); | 578 | EXPORT_SYMBOL(pcmcia_request_configuration); |
579 | 579 | ||
@@ -619,7 +619,7 @@ int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req) | |||
619 | c->io = *req; | 619 | c->io = *req; |
620 | c->state |= CONFIG_IO_REQ; | 620 | c->state |= CONFIG_IO_REQ; |
621 | p_dev->_io = 1; | 621 | p_dev->_io = 1; |
622 | return CS_SUCCESS; | 622 | return 0; |
623 | } /* pcmcia_request_io */ | 623 | } /* pcmcia_request_io */ |
624 | EXPORT_SYMBOL(pcmcia_request_io); | 624 | EXPORT_SYMBOL(pcmcia_request_io); |
625 | 625 | ||
@@ -740,7 +740,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req) | |||
740 | pcmcia_used_irq[irq]++; | 740 | pcmcia_used_irq[irq]++; |
741 | #endif | 741 | #endif |
742 | 742 | ||
743 | return CS_SUCCESS; | 743 | return 0; |
744 | } /* pcmcia_request_irq */ | 744 | } /* pcmcia_request_irq */ |
745 | EXPORT_SYMBOL(pcmcia_request_irq); | 745 | EXPORT_SYMBOL(pcmcia_request_irq); |
746 | 746 | ||
@@ -821,7 +821,7 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h | |||
821 | } | 821 | } |
822 | *wh = win; | 822 | *wh = win; |
823 | 823 | ||
824 | return CS_SUCCESS; | 824 | return 0; |
825 | } /* pcmcia_request_window */ | 825 | } /* pcmcia_request_window */ |
826 | EXPORT_SYMBOL(pcmcia_request_window); | 826 | EXPORT_SYMBOL(pcmcia_request_window); |
827 | 827 | ||
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c index 00aacbe731dc..9d04fb214ec2 100644 --- a/drivers/pcmcia/rsrc_nonstatic.c +++ b/drivers/pcmcia/rsrc_nonstatic.c | |||
@@ -134,7 +134,7 @@ static int add_interval(struct resource_map *map, u_long base, u_long num) | |||
134 | if (!q) return CS_OUT_OF_RESOURCE; | 134 | if (!q) return CS_OUT_OF_RESOURCE; |
135 | q->base = base; q->num = num; | 135 | q->base = base; q->num = num; |
136 | q->next = p->next; p->next = q; | 136 | q->next = p->next; p->next = q; |
137 | return CS_SUCCESS; | 137 | return 0; |
138 | } | 138 | } |
139 | 139 | ||
140 | /*====================================================================*/ | 140 | /*====================================================================*/ |
@@ -174,7 +174,7 @@ static int sub_interval(struct resource_map *map, u_long base, u_long num) | |||
174 | } | 174 | } |
175 | } | 175 | } |
176 | } | 176 | } |
177 | return CS_SUCCESS; | 177 | return 0; |
178 | } | 178 | } |
179 | 179 | ||
180 | /*====================================================================== | 180 | /*====================================================================== |