Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pcmcia: CodingStyle fixes

Fix several CodingStyle issues in drivers/pcmcia/ . checkpatch.pl no longer
reports errors in the PCMCIA core. The remaining warnings mostly relate to
wrong indent -- PCMCIA historically used 4 spaces --, to lines over 80
characters and to hundreds of typedefs. The cleanup of those will follow
in the future.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>

+481 -383
+3 -3
drivers/pcmcia/Kconfig
··· 64 64 If unsure, say Y. 65 65 66 66 config CARDBUS 67 - bool "32-bit CardBus support" 67 + bool "32-bit CardBus support" 68 68 depends on PCI 69 69 default y 70 70 ---help--- ··· 87 87 select PCCARD_NONSTATIC 88 88 ---help--- 89 89 This option enables support for CardBus host bridges. Virtually 90 - all modern PCMCIA bridges are CardBus compatible. A "bridge" is 91 - the hardware inside your computer that PCMCIA cards are plugged 90 + all modern PCMCIA bridges are CardBus compatible. A "bridge" is 91 + the hardware inside your computer that PCMCIA cards are plugged 92 92 into. 93 93 94 94 To compile this driver as modules, choose M here: the
+12 -11
drivers/pcmcia/cardbus.c
··· 27 27 #include <linux/mm.h> 28 28 #include <linux/pci.h> 29 29 #include <linux/ioport.h> 30 + #include <linux/io.h> 30 31 #include <asm/irq.h> 31 - #include <asm/io.h> 32 32 33 33 #include <pcmcia/cs_types.h> 34 34 #include <pcmcia/ss.h> ··· 58 58 image number and an offset within that image. xlate_rom_addr() 59 59 converts an image/offset address to an absolute offset from the 60 60 ROM's base address. 61 - 61 + 62 62 =====================================================================*/ 63 63 64 64 static u_int xlate_rom_addr(void __iomem *b, u_int addr) ··· 85 85 These are similar to setup_cis_mem and release_cis_mem for 16-bit 86 86 cards. The "result" that is used externally is the cb_cis_virt 87 87 pointer in the struct pcmcia_socket structure. 88 - 88 + 89 89 =====================================================================*/ 90 90 91 - static void cb_release_cis_mem(struct pcmcia_socket * s) 91 + static void cb_release_cis_mem(struct pcmcia_socket *s) 92 92 { 93 93 if (s->cb_cis_virt) { 94 94 dev_dbg(&s->dev, "cb_release_cis_mem()\n"); ··· 98 98 } 99 99 } 100 100 101 - static int cb_setup_cis_mem(struct pcmcia_socket * s, struct resource *res) 101 + static int cb_setup_cis_mem(struct pcmcia_socket *s, struct resource *res) 102 102 { 103 103 unsigned int start, size; 104 104 ··· 124 124 125 125 This is used by the CIS processing code to read CIS information 126 126 from a CardBus device. 127 - 127 + 128 128 =====================================================================*/ 129 129 130 - int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void *ptr) 130 + int read_cb_mem(struct pcmcia_socket *s, int space, u_int addr, u_int len, 131 + void *ptr) 131 132 { 132 133 struct pci_dev *dev; 133 134 struct resource *res; ··· 182 181 cb_alloc() and cb_free() allocate and free the kernel data 183 182 structures for a Cardbus device, and handle the lowest level PCI 184 183 device setup issues. 185 - 184 + 186 185 =====================================================================*/ 187 186 188 187 /* ··· 208 207 } 209 208 } 210 209 211 - int __ref cb_alloc(struct pcmcia_socket * s) 210 + int __ref cb_alloc(struct pcmcia_socket *s) 212 211 { 213 212 struct pci_bus *bus = s->cb_dev->subordinate; 214 213 struct pci_dev *dev; 215 214 unsigned int max, pass; 216 215 217 216 s->functions = pci_scan_slot(bus, PCI_DEVFN(0, 0)); 218 - // pcibios_fixup_bus(bus); 217 + /* pcibios_fixup_bus(bus); */ 219 218 220 219 max = bus->secondary; 221 220 for (pass = 0; pass < 2; pass++) ··· 242 241 return 0; 243 242 } 244 243 245 - void cb_free(struct pcmcia_socket * s) 244 + void cb_free(struct pcmcia_socket *s) 246 245 { 247 246 struct pci_dev *bridge = s->cb_dev; 248 247
+107 -74
drivers/pcmcia/cistpl.c
··· 23 23 #include <linux/mm.h> 24 24 #include <linux/pci.h> 25 25 #include <linux/ioport.h> 26 - #include <asm/io.h> 26 + #include <linux/io.h> 27 27 #include <asm/byteorder.h> 28 28 #include <asm/unaligned.h> 29 29 ··· 125 125 126 126 Low-level functions to read and write CIS memory. I think the 127 127 write routine is only useful for writing one-byte registers. 128 - 128 + 129 129 ======================================================================*/ 130 130 131 131 /* Bits in attr field */ ··· 137 137 { 138 138 void __iomem *sys, *end; 139 139 unsigned char *buf = ptr; 140 - 140 + 141 141 dev_dbg(&s->dev, "pcmcia_read_cis_mem(%d, %#x, %u)\n", attr, addr, len); 142 142 143 143 if (attr & IS_INDIRECT) { ··· 203 203 { 204 204 void __iomem *sys, *end; 205 205 unsigned char *buf = ptr; 206 - 206 + 207 207 dev_dbg(&s->dev, "pcmcia_write_cis_mem(%d, %#x, %u)\n", attr, addr, len); 208 208 209 209 if (attr & IS_INDIRECT) { ··· 262 262 This is a wrapper around read_cis_mem, with the same interface, 263 263 but which caches information, for cards whose CIS may not be 264 264 readable all the time. 265 - 265 + 266 266 ======================================================================*/ 267 267 268 268 static void read_cis_cache(struct pcmcia_socket *s, int attr, u_int addr, ··· 342 342 343 343 This verifies if the CIS of a card matches what is in the CIS 344 344 cache. 345 - 345 + 346 346 ======================================================================*/ 347 347 348 348 int verify_cis_cache(struct pcmcia_socket *s) ··· 381 381 382 382 For really bad cards, we provide a facility for uploading a 383 383 replacement CIS. 384 - 384 + 385 385 ======================================================================*/ 386 386 387 387 int pcmcia_replace_cis(struct pcmcia_socket *s, ··· 406 406 /*====================================================================== 407 407 408 408 The high-level CIS tuple services 409 - 409 + 410 410 ======================================================================*/ 411 411 412 412 typedef struct tuple_flags { ··· 420 420 #define HAS_LINK(f) (((tuple_flags *)(&(f)))->has_link) 421 421 #define MFC_FN(f) (((tuple_flags *)(&(f)))->mfc_fn) 422 422 #define SPACE(f) (((tuple_flags *)(&(f)))->space) 423 - 424 - int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int func, tuple_t *tuple); 425 423 426 424 int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, tuple_t *tuple) 427 425 { ··· 521 523 ofs++; continue; 522 524 } 523 525 } 524 - 526 + 525 527 /* End of chain? Follow long link if possible */ 526 528 if (link[0] == CISTPL_END) { 527 - if ((ofs = follow_link(s, tuple)) < 0) 529 + ofs = follow_link(s, tuple); 530 + if (ofs < 0) 528 531 return -ENOSPC; 529 532 attr = SPACE(tuple->Flags); 530 533 read_cis_cache(s, attr, ofs, 2, link); ··· 577 578 } else 578 579 if (tuple->DesiredTuple == RETURN_FIRST_TUPLE) 579 580 break; 580 - 581 + 581 582 if (link[0] == tuple->DesiredTuple) 582 583 break; 583 584 ofs += link[1] + 2; ··· 586 587 dev_dbg(&s->dev, "cs: overrun in pcmcia_get_next_tuple\n"); 587 588 return -ENOSPC; 588 589 } 589 - 590 + 590 591 tuple->TupleCode = link[0]; 591 592 tuple->TupleLink = link[1]; 592 593 tuple->CISOffset = ofs + 2; ··· 622 623 /*====================================================================== 623 624 624 625 Parsing routines for individual tuples 625 - 626 + 626 627 ======================================================================*/ 627 628 628 629 static int parse_device(tuple_t *tuple, cistpl_device_t *device) ··· 636 637 637 638 device->ndev = 0; 638 639 for (i = 0; i < CISTPL_MAX_DEVICES; i++) { 639 - 640 - if (*p == 0xff) break; 640 + 641 + if (*p == 0xff) 642 + break; 641 643 device->dev[i].type = (*p >> 4); 642 644 device->dev[i].wp = (*p & 0x08) ? 1 : 0; 643 645 switch (*p & 0x07) { 644 - case 0: device->dev[i].speed = 0; break; 645 - case 1: device->dev[i].speed = 250; break; 646 - case 2: device->dev[i].speed = 200; break; 647 - case 3: device->dev[i].speed = 150; break; 648 - case 4: device->dev[i].speed = 100; break; 646 + case 0: 647 + device->dev[i].speed = 0; 648 + break; 649 + case 1: 650 + device->dev[i].speed = 250; 651 + break; 652 + case 2: 653 + device->dev[i].speed = 200; 654 + break; 655 + case 3: 656 + device->dev[i].speed = 150; 657 + break; 658 + case 4: 659 + device->dev[i].speed = 100; 660 + break; 649 661 case 7: 650 - if (++p == q) 651 - return -EINVAL; 652 - device->dev[i].speed = SPEED_CVT(*p); 653 - while (*p & 0x80) 654 662 if (++p == q) 655 663 return -EINVAL; 656 - break; 664 + device->dev[i].speed = SPEED_CVT(*p); 665 + while (*p & 0x80) 666 + if (++p == q) 667 + return -EINVAL; 668 + break; 657 669 default: 658 - return -EINVAL; 670 + return -EINVAL; 659 671 } 660 672 661 673 if (++p == q) ··· 681 671 if (++p == q) 682 672 break; 683 673 } 684 - 674 + 685 675 return 0; 686 676 } 687 677 ··· 716 706 { 717 707 u_char *p; 718 708 int i; 719 - 709 + 720 710 p = (u_char *)tuple->TupleData; 721 - 711 + 722 712 link->nfn = *p; p++; 723 713 if (tuple->TupleDataLen <= link->nfn*5) 724 714 return -EINVAL; ··· 747 737 ns++; 748 738 for (;;) { 749 739 s[j++] = (*p == 0xff) ? '\0' : *p; 750 - if ((*p == '\0') || (*p == 0xff)) break; 740 + if ((*p == '\0') || (*p == 0xff)) 741 + break; 751 742 if (++p == q) 752 743 return -EINVAL; 753 744 } 754 - if ((*p == 0xff) || (++p == q)) break; 745 + if ((*p == 0xff) || (++p == q)) 746 + break; 755 747 } 756 748 if (found) { 757 749 *found = ns; ··· 768 756 static int parse_vers_1(tuple_t *tuple, cistpl_vers_1_t *vers_1) 769 757 { 770 758 u_char *p, *q; 771 - 759 + 772 760 p = (u_char *)tuple->TupleData; 773 761 q = p + tuple->TupleDataLen; 774 - 762 + 775 763 vers_1->major = *p; p++; 776 764 vers_1->minor = *p; p++; 777 765 if (p >= q) ··· 786 774 static int parse_altstr(tuple_t *tuple, cistpl_altstr_t *altstr) 787 775 { 788 776 u_char *p, *q; 789 - 777 + 790 778 p = (u_char *)tuple->TupleData; 791 779 q = p + tuple->TupleDataLen; 792 - 780 + 793 781 return parse_strings(p, q, CISTPL_MAX_ALTSTR_STRINGS, 794 782 altstr->str, altstr->ofs, &altstr->ns); 795 783 } ··· 805 793 q = p + tuple->TupleDataLen; 806 794 807 795 for (nid = 0; nid < CISTPL_MAX_DEVICES; nid++) { 808 - if (p > q-2) break; 796 + if (p > q-2) 797 + break; 809 798 jedec->id[nid].mfr = p[0]; 810 799 jedec->id[nid].info = p[1]; 811 800 p += 2; ··· 884 871 885 872 The following routines are all used to parse the nightmarish 886 873 config table entries. 887 - 874 + 888 875 ======================================================================*/ 889 876 890 877 static u_char *parse_power(u_char *p, u_char *q, ··· 893 880 int i; 894 881 u_int scale; 895 882 896 - if (p == q) return NULL; 883 + if (p == q) 884 + return NULL; 897 885 pwr->present = *p; 898 886 pwr->flags = 0; 899 887 p++; 900 888 for (i = 0; i < 7; i++) 901 889 if (pwr->present & (1<<i)) { 902 - if (p == q) return NULL; 890 + if (p == q) 891 + return NULL; 903 892 pwr->param[i] = POWER_CVT(*p); 904 893 scale = POWER_SCALE(*p); 905 894 while (*p & 0x80) { 906 - if (++p == q) return NULL; 895 + if (++p == q) 896 + return NULL; 907 897 if ((*p & 0x7f) < 100) 908 898 pwr->param[i] += (*p & 0x7f) * scale / 100; 909 899 else if (*p == 0x7d) ··· 930 914 { 931 915 u_char scale; 932 916 933 - if (p == q) return NULL; 917 + if (p == q) 918 + return NULL; 934 919 scale = *p; 935 920 if ((scale & 3) != 3) { 936 - if (++p == q) return NULL; 921 + if (++p == q) 922 + return NULL; 937 923 timing->wait = SPEED_CVT(*p); 938 924 timing->waitscale = exponent[scale & 3]; 939 925 } else 940 926 timing->wait = 0; 941 927 scale >>= 2; 942 928 if ((scale & 7) != 7) { 943 - if (++p == q) return NULL; 929 + if (++p == q) 930 + return NULL; 944 931 timing->ready = SPEED_CVT(*p); 945 932 timing->rdyscale = exponent[scale & 7]; 946 933 } else 947 934 timing->ready = 0; 948 935 scale >>= 3; 949 936 if (scale != 7) { 950 - if (++p == q) return NULL; 937 + if (++p == q) 938 + return NULL; 951 939 timing->reserved = SPEED_CVT(*p); 952 940 timing->rsvscale = exponent[scale]; 953 941 } else ··· 966 946 { 967 947 int i, j, bsz, lsz; 968 948 969 - if (p == q) return NULL; 949 + if (p == q) 950 + return NULL; 970 951 io->flags = *p; 971 952 972 953 if (!(*p & 0x80)) { ··· 976 955 io->win[0].len = (1 << (io->flags & CISTPL_IO_LINES_MASK)); 977 956 return p+1; 978 957 } 979 - 980 - if (++p == q) return NULL; 958 + 959 + if (++p == q) 960 + return NULL; 981 961 io->nwin = (*p & 0x0f) + 1; 982 962 bsz = (*p & 0x30) >> 4; 983 - if (bsz == 3) bsz++; 963 + if (bsz == 3) 964 + bsz++; 984 965 lsz = (*p & 0xc0) >> 6; 985 - if (lsz == 3) lsz++; 966 + if (lsz == 3) 967 + lsz++; 986 968 p++; 987 - 969 + 988 970 for (i = 0; i < io->nwin; i++) { 989 971 io->win[i].base = 0; 990 972 io->win[i].len = 1; 991 973 for (j = 0; j < bsz; j++, p++) { 992 - if (p == q) return NULL; 974 + if (p == q) 975 + return NULL; 993 976 io->win[i].base += *p << (j*8); 994 977 } 995 978 for (j = 0; j < lsz; j++, p++) { 996 - if (p == q) return NULL; 979 + if (p == q) 980 + return NULL; 997 981 io->win[i].len += *p << (j*8); 998 982 } 999 983 } ··· 1012 986 int i, j, asz, lsz, has_ha; 1013 987 u_int len, ca, ha; 1014 988 1015 - if (p == q) return NULL; 989 + if (p == q) 990 + return NULL; 1016 991 1017 992 mem->nwin = (*p & 0x07) + 1; 1018 993 lsz = (*p & 0x18) >> 3; 1019 994 asz = (*p & 0x60) >> 5; 1020 995 has_ha = (*p & 0x80); 1021 - if (++p == q) return NULL; 1022 - 996 + if (++p == q) 997 + return NULL; 998 + 1023 999 for (i = 0; i < mem->nwin; i++) { 1024 1000 len = ca = ha = 0; 1025 1001 for (j = 0; j < lsz; j++, p++) { 1026 - if (p == q) return NULL; 1002 + if (p == q) 1003 + return NULL; 1027 1004 len += *p << (j*8); 1028 1005 } 1029 1006 for (j = 0; j < asz; j++, p++) { 1030 - if (p == q) return NULL; 1007 + if (p == q) 1008 + return NULL; 1031 1009 ca += *p << (j*8); 1032 1010 } 1033 1011 if (has_ha) 1034 1012 for (j = 0; j < asz; j++, p++) { 1035 - if (p == q) return NULL; 1013 + if (p == q) 1014 + return NULL; 1036 1015 ha += *p << (j*8); 1037 1016 } 1038 1017 mem->win[i].len = len << 8; ··· 1126 1095 entry->timing.ready = 0; 1127 1096 entry->timing.reserved = 0; 1128 1097 } 1129 - 1098 + 1130 1099 /* I/O window options */ 1131 1100 if (features & 0x08) { 1132 1101 p = parse_io(p, q, &entry->io); ··· 1134 1103 return -EINVAL; 1135 1104 } else 1136 1105 entry->io.nwin = 0; 1137 - 1106 + 1138 1107 /* Interrupt options */ 1139 1108 if (features & 0x10) { 1140 1109 p = parse_irq(p, q, &entry->irq); ··· 1184 1153 } 1185 1154 1186 1155 entry->subtuples = q-p; 1187 - 1156 + 1188 1157 return 0; 1189 1158 } 1190 1159 ··· 1207 1176 static int parse_config_cb(tuple_t *tuple, cistpl_config_t *config) 1208 1177 { 1209 1178 u_char *p; 1210 - 1179 + 1211 1180 p = (u_char *)tuple->TupleData; 1212 1181 if ((*p != 3) || (tuple->TupleDataLen < 6)) 1213 1182 return -EINVAL; ··· 1262 1231 entry->io = *p; p++; 1263 1232 } else 1264 1233 entry->io = 0; 1265 - 1234 + 1266 1235 /* Interrupt options */ 1267 1236 if (features & 0x10) { 1268 1237 p = parse_irq(p, q, &entry->irq); ··· 1295 1264 } 1296 1265 1297 1266 entry->subtuples = q-p; 1298 - 1267 + 1299 1268 return 0; 1300 1269 } 1301 1270 ··· 1312 1281 q = p + tuple->TupleDataLen; 1313 1282 1314 1283 for (n = 0; n < CISTPL_MAX_DEVICES; n++) { 1315 - if (p > q-6) break; 1284 + if (p > q-6) 1285 + break; 1316 1286 geo->geo[n].buswidth = p[0]; 1317 1287 geo->geo[n].erase_block = 1 << (p[1]-1); 1318 1288 geo->geo[n].read_block = 1 << (p[2]-1); ··· 1334 1302 1335 1303 if (tuple->TupleDataLen < 10) 1336 1304 return -EINVAL; 1337 - 1305 + 1338 1306 p = tuple->TupleData; 1339 1307 q = p + tuple->TupleDataLen; 1340 1308 1341 1309 v2->vers = p[0]; 1342 1310 v2->comply = p[1]; 1343 - v2->dindex = get_unaligned_le16(p +2 ); 1311 + v2->dindex = get_unaligned_le16(p + 2); 1344 1312 v2->vspec8 = p[6]; 1345 1313 v2->vspec9 = p[7]; 1346 1314 v2->nhdr = p[8]; ··· 1354 1322 { 1355 1323 u_char *p, *q; 1356 1324 int i; 1357 - 1325 + 1358 1326 p = tuple->TupleData; 1359 1327 q = p + tuple->TupleDataLen; 1360 1328 if (p == q) ··· 1364 1332 return -EINVAL; 1365 1333 for (i = 0; i < 30; i++) { 1366 1334 org->desc[i] = *p; 1367 - if (*p == '\0') break; 1335 + if (*p == '\0') 1336 + break; 1368 1337 if (++p == q) 1369 1338 return -EINVAL; 1370 1339 } ··· 1396 1363 int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse) 1397 1364 { 1398 1365 int ret = 0; 1399 - 1366 + 1400 1367 if (tuple->TupleDataLen > tuple->TupleDataMax) 1401 1368 return -EINVAL; 1402 1369 switch (tuple->TupleCode) { ··· 1481 1448 /*====================================================================== 1482 1449 1483 1450 This is used internally by Card Services to look up CIS stuff. 1484 - 1451 + 1485 1452 ======================================================================*/ 1486 1453 1487 1454 int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function, cisdata_t code, void *parse) ··· 1583 1550 checks include making sure several critical tuples are present and 1584 1551 valid; seeing if the total number of tuples is reasonable; and 1585 1552 looking for tuples that use reserved codes. 1586 - 1553 + 1587 1554 ======================================================================*/ 1588 1555 1589 1556 int pccard_validate_cis(struct pcmcia_socket *s, unsigned int *info)
+6 -6
drivers/pcmcia/cs.c
··· 135 135 EXPORT_SYMBOL(pcmcia_socket_dev_resume); 136 136 137 137 138 - struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt) 138 + struct pcmcia_socket *pcmcia_get_socket(struct pcmcia_socket *skt) 139 139 { 140 140 struct device *dev = get_device(&skt->dev); 141 141 if (!dev) ··· 145 145 put_device(&skt->dev); 146 146 return NULL; 147 147 } 148 - return (skt); 148 + return skt; 149 149 } 150 150 EXPORT_SYMBOL(pcmcia_get_socket); 151 151 ··· 297 297 EXPORT_SYMBOL(pcmcia_unregister_socket); 298 298 299 299 300 - struct pcmcia_socket * pcmcia_get_socket_by_nr(unsigned int nr) 300 + struct pcmcia_socket *pcmcia_get_socket_by_nr(unsigned int nr) 301 301 { 302 302 struct pcmcia_socket *s; 303 303 ··· 736 736 /* register pcmcia_callback */ 737 737 int pccard_register_pcmcia(struct pcmcia_socket *s, struct pcmcia_callback *c) 738 738 { 739 - int ret = 0; 739 + int ret = 0; 740 740 741 741 /* s->skt_mutex also protects s->callback */ 742 742 mutex_lock(&s->skt_mutex); ··· 848 848 int pcmcia_resume_card(struct pcmcia_socket *skt) 849 849 { 850 850 int ret; 851 - 851 + 852 852 dev_dbg(&skt->dev, "waking up socket\n"); 853 853 854 854 mutex_lock(&skt->skt_mutex); ··· 876 876 int pcmcia_eject_card(struct pcmcia_socket *skt) 877 877 { 878 878 int ret; 879 - 879 + 880 880 dev_dbg(&skt->dev, "user eject request\n"); 881 881 882 882 mutex_lock(&skt->skt_mutex);
+34 -32
drivers/pcmcia/ds.c
··· 57 57 "function\n", p_drv->drv.name); 58 58 59 59 while (did && did->match_flags) { 60 - for (i=0; i<4; i++) { 60 + for (i = 0; i < 4; i++) { 61 61 if (!did->prod_id[i]) 62 62 continue; 63 63 ··· 105 105 __u16 match_flags, manf_id, card_id; 106 106 __u8 func_id, function, device_no; 107 107 __u32 prod_id_hash[4] = {0, 0, 0, 0}; 108 - int fields=0; 108 + int fields = 0; 109 109 int retval = 0; 110 110 111 111 fields = sscanf(buf, "%hx %hx %hx %hhx %hhx %hhx %x %x %x %x", ··· 214 214 215 215 /* pcmcia_device handling */ 216 216 217 - struct pcmcia_device * pcmcia_get_dev(struct pcmcia_device *p_dev) 217 + struct pcmcia_device *pcmcia_get_dev(struct pcmcia_device *p_dev) 218 218 { 219 219 struct device *tmp_dev; 220 220 tmp_dev = get_device(&p_dev->dev); ··· 258 258 return; 259 259 } 260 260 261 - static int pcmcia_device_probe(struct device * dev) 261 + static int pcmcia_device_probe(struct device *dev) 262 262 { 263 263 struct pcmcia_device *p_dev; 264 264 struct pcmcia_driver *p_drv; ··· 325 325 put_dev: 326 326 if (ret) 327 327 put_device(dev); 328 - return (ret); 328 + return ret; 329 329 } 330 330 331 331 ··· 354 354 355 355 spin_lock_irqsave(&pcmcia_dev_list_lock, flags); 356 356 list_del(&p_dev->socket_device_list); 357 - p_dev->_removed=1; 357 + p_dev->_removed = 1; 358 358 spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); 359 359 360 360 dev_dbg(&p_dev->dev, "unregistering device\n"); ··· 364 364 return; 365 365 } 366 366 367 - static int pcmcia_device_remove(struct device * dev) 367 + static int pcmcia_device_remove(struct device *dev) 368 368 { 369 369 struct pcmcia_device *p_dev; 370 370 struct pcmcia_driver *p_drv; ··· 391 391 return 0; 392 392 393 393 if (p_drv->remove) 394 - p_drv->remove(p_dev); 394 + p_drv->remove(p_dev); 395 395 396 396 p_dev->dev_node = NULL; 397 397 ··· 499 499 */ 500 500 static DEFINE_MUTEX(device_add_lock); 501 501 502 - struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int function) 502 + struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int function) 503 503 { 504 504 struct pcmcia_device *p_dev, *tmp_dev; 505 505 unsigned long flags; ··· 545 545 * Note that this is serialized by the device_add_lock, so that 546 546 * only one such struct will be created. 547 547 */ 548 - list_for_each_entry(tmp_dev, &s->devices_list, socket_device_list) 549 - if (p_dev->func == tmp_dev->func) { 548 + list_for_each_entry(tmp_dev, &s->devices_list, socket_device_list) 549 + if (p_dev->func == tmp_dev->func) { 550 550 p_dev->function_config = tmp_dev->function_config; 551 551 p_dev->io = tmp_dev->io; 552 552 p_dev->irq = tmp_dev->irq; ··· 627 627 no_funcs = 1; 628 628 s->functions = no_funcs; 629 629 630 - for (i=0; i < no_funcs; i++) 630 + for (i = 0; i < no_funcs; i++) 631 631 pcmcia_device_add(s, i); 632 632 633 - return (ret); 633 + return ret; 634 634 } 635 635 636 636 ··· 756 756 release: 757 757 release_firmware(fw); 758 758 759 - return (ret); 759 + return ret; 760 760 } 761 761 762 762 #else /* !CONFIG_PCMCIA_LOAD_CIS */ ··· 852 852 853 853 if (did->match_flags & PCMCIA_DEV_ID_MATCH_ANONYMOUS) { 854 854 int i; 855 - for (i=0; i<4; i++) 855 + for (i = 0; i < 4; i++) 856 856 if (dev->prod_id[i]) 857 857 return 0; 858 858 if (dev->has_manf_id || dev->has_card_id || dev->has_func_id) ··· 865 865 } 866 866 867 867 868 - static int pcmcia_bus_match(struct device * dev, struct device_driver * drv) { 869 - struct pcmcia_device * p_dev = to_pcmcia_dev(dev); 870 - struct pcmcia_driver * p_drv = to_pcmcia_drv(drv); 868 + static int pcmcia_bus_match(struct device *dev, struct device_driver *drv) 869 + { 870 + struct pcmcia_device *p_dev = to_pcmcia_dev(dev); 871 + struct pcmcia_driver *p_drv = to_pcmcia_drv(drv); 871 872 struct pcmcia_device_id *did = p_drv->id_table; 872 873 struct pcmcia_dynid *dynid; 873 874 ··· 918 917 p_dev = to_pcmcia_dev(dev); 919 918 920 919 /* calculate hashes */ 921 - for (i=0; i<4; i++) { 920 + for (i = 0; i < 4; i++) { 922 921 if (!p_dev->prod_id[i]) 923 922 continue; 924 923 hash[i] = crc32(0, p_dev->prod_id[i], strlen(p_dev->prod_id[i])); ··· 985 984 static ssize_t field##_show (struct device *dev, struct device_attribute *attr, char *buf) \ 986 985 { \ 987 986 struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \ 988 - return p_dev->test ? sprintf (buf, format, p_dev->field) : -ENODEV; \ 987 + return p_dev->test ? sprintf(buf, format, p_dev->field) : -ENODEV; \ 989 988 } 990 989 991 990 #define pcmcia_device_stringattr(name, field) \ 992 991 static ssize_t name##_show (struct device *dev, struct device_attribute *attr, char *buf) \ 993 992 { \ 994 993 struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \ 995 - return p_dev->field ? sprintf (buf, "%s\n", p_dev->field) : -ENODEV; \ 994 + return p_dev->field ? sprintf(buf, "%s\n", p_dev->field) : -ENODEV; \ 996 995 } 997 996 998 997 pcmcia_device_attr(func, socket, "0x%02x\n"); ··· 1021 1020 struct pcmcia_device *p_dev = to_pcmcia_dev(dev); 1022 1021 int ret = 0; 1023 1022 1024 - if (!count) 1025 - return -EINVAL; 1023 + if (!count) 1024 + return -EINVAL; 1026 1025 1027 1026 if ((!p_dev->suspended) && !strncmp(buf, "off", 3)) 1028 1027 ret = runtime_suspend(dev); ··· 1040 1039 u32 hash[4] = { 0, 0, 0, 0}; 1041 1040 1042 1041 /* calculate hashes */ 1043 - for (i=0; i<4; i++) { 1042 + for (i = 0; i < 4; i++) { 1044 1043 if (!p_dev->prod_id[i]) 1045 1044 continue; 1046 - hash[i] = crc32(0,p_dev->prod_id[i],strlen(p_dev->prod_id[i])); 1045 + hash[i] = crc32(0, p_dev->prod_id[i], 1046 + strlen(p_dev->prod_id[i])); 1047 1047 } 1048 1048 return sprintf(buf, "pcmcia:m%04Xc%04Xf%02Xfn%02Xpfn%02X" 1049 1049 "pa%08Xpb%08Xpc%08Xpd%08X\n", ··· 1093 1091 1094 1092 /* PM support, also needed for reset */ 1095 1093 1096 - static int pcmcia_dev_suspend(struct device * dev, pm_message_t state) 1094 + static int pcmcia_dev_suspend(struct device *dev, pm_message_t state) 1097 1095 { 1098 1096 struct pcmcia_device *p_dev = to_pcmcia_dev(dev); 1099 1097 struct pcmcia_driver *p_drv = NULL; ··· 1133 1131 } 1134 1132 1135 1133 1136 - static int pcmcia_dev_resume(struct device * dev) 1134 + static int pcmcia_dev_resume(struct device *dev) 1137 1135 { 1138 1136 struct pcmcia_device *p_dev = to_pcmcia_dev(dev); 1139 - struct pcmcia_driver *p_drv = NULL; 1137 + struct pcmcia_driver *p_drv = NULL; 1140 1138 int ret = 0; 1141 1139 1142 1140 if (!p_dev->suspended) ··· 1213 1211 /*====================================================================== 1214 1212 1215 1213 The card status event handler. 1216 - 1214 + 1217 1215 ======================================================================*/ 1218 1216 1219 1217 /* Normally, the event is passed to individual drivers after ··· 1266 1264 } /* ds_event */ 1267 1265 1268 1266 1269 - struct pcmcia_device * pcmcia_dev_present(struct pcmcia_device *_p_dev) 1267 + struct pcmcia_device *pcmcia_dev_present(struct pcmcia_device *_p_dev) 1270 1268 { 1271 1269 struct pcmcia_device *p_dev; 1272 1270 struct pcmcia_device *ret = NULL; ··· 1331 1329 if (ret) { 1332 1330 dev_printk(KERN_ERR, dev, "PCMCIA registration failed\n"); 1333 1331 pcmcia_put_socket(socket); 1334 - return (ret); 1332 + return ret; 1335 1333 } 1336 1334 1337 1335 return 0; ··· 1402 1400 1403 1401 return 0; 1404 1402 } 1405 - fs_initcall(init_pcmcia_bus); /* one level after subsys_initcall so that 1403 + fs_initcall(init_pcmcia_bus); /* one level after subsys_initcall so that 1406 1404 * pcmcia_socket_class is already registered */ 1407 1405 1408 1406
+25 -20
drivers/pcmcia/pcmcia_ioctl.c
··· 88 88 89 89 p_drv = container_of(drv, struct pcmcia_driver, drv); 90 90 91 - return (p_drv); 91 + return p_drv; 92 92 } 93 93 94 94 95 95 #ifdef CONFIG_PROC_FS 96 - static struct proc_dir_entry *proc_pccard = NULL; 96 + static struct proc_dir_entry *proc_pccard; 97 97 98 98 static int proc_read_drivers_callback(struct device_driver *driver, void *_m) 99 99 { ··· 158 158 159 159 #else 160 160 161 - static inline int adjust_irq(struct pcmcia_socket *s, adjust_t *adj) { 161 + static inline int adjust_irq(struct pcmcia_socket *s, adjust_t *adj) 162 + { 162 163 return 0; 163 164 } 164 165 ··· 196 195 begin = adj->resource.memory.Base; 197 196 end = adj->resource.memory.Base + adj->resource.memory.Size - 1; 198 197 if (s->resource_ops->add_mem) 199 - ret =s->resource_ops->add_mem(s, adj->Action, begin, end); 198 + ret = s->resource_ops->add_mem(s, adj->Action, begin, end); 200 199 case RES_IO_RANGE: 201 200 begin = adj->resource.io.BasePort; 202 201 end = adj->resource.io.BasePort + adj->resource.io.NumPorts - 1; ··· 216 215 } 217 216 up_read(&pcmcia_socket_list_rwsem); 218 217 219 - return (ret); 218 + return ret; 220 219 } 221 220 222 221 ··· 491 490 } 492 491 493 492 spin_lock_irqsave(&pcmcia_dev_list_lock, flags); 494 - list_for_each_entry(p_dev, &s->devices_list, socket_device_list) { 493 + list_for_each_entry(p_dev, &s->devices_list, socket_device_list) { 495 494 if (p_dev->func == bind_info->function) { 496 495 if ((p_dev->dev.driver == &p_drv->drv)) { 497 496 if (p_dev->cardmgr) { ··· 559 558 err_put: 560 559 pcmcia_put_socket(s); 561 560 562 - return (ret); 561 + return ret; 563 562 } /* bind_request */ 564 563 565 564 #ifdef CONFIG_CARDBUS ··· 656 655 657 656 err_put: 658 657 pcmcia_put_dev(p_dev); 659 - return (ret); 658 + return ret; 660 659 } /* get_device_info */ 661 660 662 661 ··· 665 664 socket_t i = iminor(inode); 666 665 struct pcmcia_socket *s; 667 666 user_info_t *user; 668 - static int warning_printed = 0; 667 + static int warning_printed; 669 668 int ret = 0; 670 669 671 670 pr_debug("ds_open(socket %d)\n", i); ··· 739 738 s = user->socket; 740 739 741 740 /* Unlink user data structure */ 742 - if ((file->f_flags & O_ACCMODE) != O_RDONLY) { 741 + if ((file->f_flags & O_ACCMODE) != O_RDONLY) 743 742 s->pcmcia_state.busy = 0; 744 - } 743 + 745 744 file->private_data = NULL; 746 745 for (link = &s->user; *link; link = &(*link)->next) 747 - if (*link == user) break; 746 + if (*link == user) 747 + break; 748 748 if (link == NULL) 749 749 goto out; 750 750 *link = user->next; ··· 776 774 777 775 s = user->socket; 778 776 if (s->pcmcia_state.dead) 779 - return -EIO; 777 + return -EIO; 780 778 781 779 ret = wait_event_interruptible(s->queue, !queue_empty(user)); 782 780 if (ret == 0) ··· 826 824 827 825 /*====================================================================*/ 828 826 829 - static int ds_ioctl(struct inode * inode, struct file * file, 827 + static int ds_ioctl(struct inode *inode, struct file *file, 830 828 u_int cmd, u_long arg) 831 829 { 832 830 struct pcmcia_socket *s; ··· 844 842 845 843 s = user->socket; 846 844 if (s->pcmcia_state.dead) 847 - return -EIO; 845 + return -EIO; 848 846 849 847 size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT; 850 - if (size > sizeof(ds_ioctl_arg_t)) return -EINVAL; 848 + if (size > sizeof(ds_ioctl_arg_t)) 849 + return -EINVAL; 851 850 852 851 /* Permission check */ 853 852 if (!(cmd & IOC_OUT) && !capable(CAP_SYS_ADMIN)) ··· 1027 1024 } 1028 1025 1029 1026 if (cmd & IOC_OUT) { 1030 - if (__copy_to_user(uarg, (char *)buf, size)) 1031 - err = -EFAULT; 1027 + if (__copy_to_user(uarg, (char *)buf, size)) 1028 + err = -EFAULT; 1032 1029 } 1033 1030 1034 1031 free_out: ··· 1048 1045 .poll = ds_poll, 1049 1046 }; 1050 1047 1051 - void __init pcmcia_setup_ioctl(void) { 1048 + void __init pcmcia_setup_ioctl(void) 1049 + { 1052 1050 int i; 1053 1051 1054 1052 /* Set up character device for user mode clients */ ··· 1068 1064 } 1069 1065 1070 1066 1071 - void __exit pcmcia_cleanup_ioctl(void) { 1067 + void __exit pcmcia_cleanup_ioctl(void) 1068 + { 1072 1069 #ifdef CONFIG_PROC_FS 1073 1070 if (proc_pccard) { 1074 1071 remove_proc_entry("drivers", proc_pccard);
+20 -17
drivers/pcmcia/pcmcia_resource.c
··· 33 33 34 34 35 35 /* Access speed for IO windows */ 36 - static int io_speed = 0; 36 + static int io_speed; 37 37 module_param(io_speed, int, 0444); 38 38 39 39 ··· 62 62 num, align); 63 63 align = 0; 64 64 } else 65 - while (align && (align < num)) align <<= 1; 65 + while (align && (align < num)) 66 + align <<= 1; 66 67 } 67 68 if (*base & ~(align-1)) { 68 69 dev_dbg(&s->dev, "odd IO request: base %#x align %#x\n", ··· 339 338 struct pcmcia_socket *s = p_dev->socket; 340 339 config_t *c = p_dev->function_config; 341 340 342 - if (!p_dev->_io ) 341 + if (!p_dev->_io) 343 342 return -EINVAL; 344 343 345 344 p_dev->_io = 0; ··· 363 362 static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req) 364 363 { 365 364 struct pcmcia_socket *s = p_dev->socket; 366 - config_t *c= p_dev->function_config; 365 + config_t *c = p_dev->function_config; 367 366 368 367 if (!p_dev->_irq) 369 368 return -EINVAL; ··· 384 383 s->irq.AssignedIRQ = 0; 385 384 } 386 385 387 - if (req->Handler) { 386 + if (req->Handler) 388 387 free_irq(req->AssignedIRQ, p_dev->priv); 389 - } 390 388 391 389 #ifdef CONFIG_PCMCIA_PROBE 392 390 pcmcia_used_irq[req->AssignedIRQ]--; ··· 656 656 type = IRQF_SHARED; 657 657 else if (req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) 658 658 type = IRQF_SHARED; 659 - else printk(KERN_WARNING "pcmcia: Driver needs updating to support IRQ sharing.\n"); 659 + else 660 + printk(KERN_WARNING "pcmcia: Driver needs updating to support IRQ sharing.\n"); 660 661 661 662 #ifdef CONFIG_PCMCIA_PROBE 662 663 ··· 789 788 790 789 /* Allocate system memory window */ 791 790 for (w = 0; w < MAX_WIN; w++) 792 - if (!(s->state & SOCKET_WIN_REQ(w))) break; 791 + if (!(s->state & SOCKET_WIN_REQ(w))) 792 + break; 793 793 if (w == MAX_WIN) { 794 794 dev_dbg(&s->dev, "all windows are used already\n"); 795 795 return -EINVAL; ··· 828 826 s->state |= SOCKET_WIN_REQ(w); 829 827 830 828 /* Return window handle */ 831 - if (s->features & SS_CAP_STATIC_MAP) { 829 + if (s->features & SS_CAP_STATIC_MAP) 832 830 req->Base = win->static_start; 833 - } else { 831 + else 834 832 req->Base = win->res->start; 835 - } 833 + 836 834 *wh = w + 1; 837 835 838 836 return 0; 839 837 } /* pcmcia_request_window */ 840 838 EXPORT_SYMBOL(pcmcia_request_window); 841 839 842 - void pcmcia_disable_device(struct pcmcia_device *p_dev) { 840 + void pcmcia_disable_device(struct pcmcia_device *p_dev) 841 + { 843 842 pcmcia_release_configuration(p_dev); 844 843 pcmcia_release_io(p_dev, &p_dev->io); 845 844 pcmcia_release_irq(p_dev, &p_dev->irq); ··· 973 970 974 971 return pccard_loop_tuple(p_dev->socket, p_dev->func, code, NULL, 975 972 &loop, pcmcia_do_loop_tuple); 976 - }; 973 + } 977 974 EXPORT_SYMBOL(pcmcia_loop_tuple); 978 975 979 976 ··· 1003 1000 } else 1004 1001 dev_dbg(&p_dev->dev, "do_get_tuple: out of memory\n"); 1005 1002 return 0; 1006 - }; 1003 + } 1007 1004 1008 1005 /** 1009 1006 * pcmcia_get_tuple() - get first tuple from CIS ··· 1027 1024 pcmcia_loop_tuple(p_dev, code, pcmcia_do_get_tuple, &get); 1028 1025 1029 1026 return get.len; 1030 - }; 1027 + } 1031 1028 EXPORT_SYMBOL(pcmcia_get_tuple); 1032 1029 1033 1030 ··· 1060 1057 for (i = 0; i < 6; i++) 1061 1058 dev->dev_addr[i] = tuple->TupleData[i+2]; 1062 1059 return 0; 1063 - }; 1060 + } 1064 1061 1065 1062 /** 1066 1063 * pcmcia_get_mac_from_cis() - read out MAC address from CISTPL_FUNCE ··· 1074 1071 int pcmcia_get_mac_from_cis(struct pcmcia_device *p_dev, struct net_device *dev) 1075 1072 { 1076 1073 return pcmcia_loop_tuple(p_dev, CISTPL_FUNCE, pcmcia_do_get_mac, dev); 1077 - }; 1074 + } 1078 1075 EXPORT_SYMBOL(pcmcia_get_mac_from_cis); 1079 1076
+7 -7
drivers/pcmcia/rsrc_mgr.c
··· 126 126 res->start = start; 127 127 128 128 #ifdef CONFIG_X86 129 - if (res->flags & IORESOURCE_IO) { 130 - if (start & 0x300) { 131 - start = (start + 0x3ff) & ~0x3ff; 132 - res->start = start; 133 - } 134 - } 129 + if (res->flags & IORESOURCE_IO) { 130 + if (start & 0x300) { 131 + start = (start + 0x3ff) & ~0x3ff; 132 + res->start = start; 133 + } 134 + } 135 135 #endif 136 136 137 137 #ifdef CONFIG_M68K 138 - if (res->flags & IORESOURCE_IO) { 138 + if (res->flags & IORESOURCE_IO) { 139 139 if ((res->start + size - 1) >= 1024) 140 140 res->start = res->end; 141 141 }
+158 -149
drivers/pcmcia/rsrc_nonstatic.c
··· 24 24 #include <linux/timer.h> 25 25 #include <linux/pci.h> 26 26 #include <linux/device.h> 27 + #include <linux/io.h> 27 28 28 29 #include <asm/irq.h> 29 - #include <asm/io.h> 30 30 31 31 #include <pcmcia/cs_types.h> 32 32 #include <pcmcia/ss.h> ··· 144 144 145 145 static int sub_interval(struct resource_map *map, u_long base, u_long num) 146 146 { 147 - struct resource_map *p, *q; 147 + struct resource_map *p, *q; 148 148 149 - for (p = map; ; p = q) { 150 - q = p->next; 151 - if (q == map) 152 - break; 153 - if ((q->base+q->num > base) && (base+num > q->base)) { 154 - if (q->base >= base) { 155 - if (q->base+q->num <= base+num) { 156 - /* Delete whole block */ 157 - p->next = q->next; 158 - kfree(q); 159 - /* don't advance the pointer yet */ 160 - q = p; 161 - } else { 162 - /* Cut off bit from the front */ 163 - q->num = q->base + q->num - base - num; 164 - q->base = base + num; 149 + for (p = map; ; p = q) { 150 + q = p->next; 151 + if (q == map) 152 + break; 153 + if ((q->base+q->num > base) && (base+num > q->base)) { 154 + if (q->base >= base) { 155 + if (q->base+q->num <= base+num) { 156 + /* Delete whole block */ 157 + p->next = q->next; 158 + kfree(q); 159 + /* don't advance the pointer yet */ 160 + q = p; 161 + } else { 162 + /* Cut off bit from the front */ 163 + q->num = q->base + q->num - base - num; 164 + q->base = base + num; 165 + } 166 + } else if (q->base+q->num <= base+num) { 167 + /* Cut off bit from the end */ 168 + q->num = base - q->base; 169 + } else { 170 + /* Split the block into two pieces */ 171 + p = kmalloc(sizeof(struct resource_map), 172 + GFP_KERNEL); 173 + if (!p) { 174 + printk(KERN_WARNING "out of memory to update resources\n"); 175 + return -ENOMEM; 176 + } 177 + p->base = base+num; 178 + p->num = q->base+q->num - p->base; 179 + q->num = base - q->base; 180 + p->next = q->next ; q->next = p; 181 + } 165 182 } 166 - } else if (q->base+q->num <= base+num) { 167 - /* Cut off bit from the end */ 168 - q->num = base - q->base; 169 - } else { 170 - /* Split the block into two pieces */ 171 - p = kmalloc(sizeof(struct resource_map), GFP_KERNEL); 172 - if (!p) { 173 - printk(KERN_WARNING "out of memory to update resources\n"); 174 - return -ENOMEM; 175 - } 176 - p->base = base+num; 177 - p->num = q->base+q->num - p->base; 178 - q->num = base - q->base; 179 - p->next = q->next ; q->next = p; 180 - } 181 183 } 182 - } 183 - return 0; 184 + return 0; 184 185 } 185 186 186 187 /*====================================================================== ··· 195 194 static void do_io_probe(struct pcmcia_socket *s, unsigned int base, 196 195 unsigned int num) 197 196 { 198 - struct resource *res; 199 - struct socket_data *s_data = s->resource_data; 200 - unsigned int i, j, bad; 201 - int any; 202 - u_char *b, hole, most; 197 + struct resource *res; 198 + struct socket_data *s_data = s->resource_data; 199 + unsigned int i, j, bad; 200 + int any; 201 + u_char *b, hole, most; 203 202 204 - dev_printk(KERN_INFO, &s->dev, "cs: IO port probe %#x-%#x:", 205 - base, base+num-1); 203 + dev_printk(KERN_INFO, &s->dev, "cs: IO port probe %#x-%#x:", 204 + base, base+num-1); 206 205 207 - /* First, what does a floating port look like? */ 208 - b = kzalloc(256, GFP_KERNEL); 209 - if (!b) { 210 - printk("\n"); 211 - dev_printk(KERN_ERR, &s->dev, 212 - "do_io_probe: unable to kmalloc 256 bytes"); 213 - return; 214 - } 215 - for (i = base, most = 0; i < base+num; i += 8) { 216 - res = claim_region(NULL, i, 8, IORESOURCE_IO, "PCMCIA IO probe"); 217 - if (!res) 218 - continue; 219 - hole = inb(i); 220 - for (j = 1; j < 8; j++) 221 - if (inb(i+j) != hole) break; 222 - free_region(res); 223 - if ((j == 8) && (++b[hole] > b[most])) 224 - most = hole; 225 - if (b[most] == 127) break; 226 - } 227 - kfree(b); 228 - 229 - bad = any = 0; 230 - for (i = base; i < base+num; i += 8) { 231 - res = claim_region(NULL, i, 8, IORESOURCE_IO, "PCMCIA IO probe"); 232 - if (!res) 233 - continue; 234 - for (j = 0; j < 8; j++) 235 - if (inb(i+j) != most) break; 236 - free_region(res); 237 - if (j < 8) { 238 - if (!any) 239 - printk(" excluding"); 240 - if (!bad) 241 - bad = any = i; 242 - } else { 243 - if (bad) { 244 - sub_interval(&s_data->io_db, bad, i-bad); 245 - printk(" %#x-%#x", bad, i-1); 246 - bad = 0; 247 - } 206 + /* First, what does a floating port look like? */ 207 + b = kzalloc(256, GFP_KERNEL); 208 + if (!b) { 209 + printk("\n"); 210 + dev_printk(KERN_ERR, &s->dev, 211 + "do_io_probe: unable to kmalloc 256 bytes"); 212 + return; 248 213 } 249 - } 250 - if (bad) { 251 - if ((num > 16) && (bad == base) && (i == base+num)) { 252 - printk(" nothing: probe failed.\n"); 253 - return; 254 - } else { 255 - sub_interval(&s_data->io_db, bad, i-bad); 256 - printk(" %#x-%#x", bad, i-1); 214 + for (i = base, most = 0; i < base+num; i += 8) { 215 + res = claim_region(NULL, i, 8, IORESOURCE_IO, "PCMCIA ioprobe"); 216 + if (!res) 217 + continue; 218 + hole = inb(i); 219 + for (j = 1; j < 8; j++) 220 + if (inb(i+j) != hole) 221 + break; 222 + free_region(res); 223 + if ((j == 8) && (++b[hole] > b[most])) 224 + most = hole; 225 + if (b[most] == 127) 226 + break; 257 227 } 258 - } 228 + kfree(b); 259 229 260 - printk(any ? "\n" : " clean.\n"); 230 + bad = any = 0; 231 + for (i = base; i < base+num; i += 8) { 232 + res = claim_region(NULL, i, 8, IORESOURCE_IO, "PCMCIA ioprobe"); 233 + if (!res) 234 + continue; 235 + for (j = 0; j < 8; j++) 236 + if (inb(i+j) != most) 237 + break; 238 + free_region(res); 239 + if (j < 8) { 240 + if (!any) 241 + printk(" excluding"); 242 + if (!bad) 243 + bad = any = i; 244 + } else { 245 + if (bad) { 246 + sub_interval(&s_data->io_db, bad, i-bad); 247 + printk(" %#x-%#x", bad, i-1); 248 + bad = 0; 249 + } 250 + } 251 + } 252 + if (bad) { 253 + if ((num > 16) && (bad == base) && (i == base+num)) { 254 + printk(" nothing: probe failed.\n"); 255 + return; 256 + } else { 257 + sub_interval(&s_data->io_db, bad, i-bad); 258 + printk(" %#x-%#x", bad, i-1); 259 + } 260 + } 261 + 262 + printk(any ? "\n" : " clean.\n"); 261 263 } 262 264 #endif 263 265 ··· 331 327 unsigned int info1, info2; 332 328 int ret = 0; 333 329 334 - res1 = claim_region(s, base, size/2, IORESOURCE_MEM, "cs memory probe"); 335 - res2 = claim_region(s, base + size/2, size/2, IORESOURCE_MEM, "cs memory probe"); 330 + res1 = claim_region(s, base, size/2, IORESOURCE_MEM, "PCMCIA memprobe"); 331 + res2 = claim_region(s, base + size/2, size/2, IORESOURCE_MEM, 332 + "PCMCIA memprobe"); 336 333 337 334 if (res1 && res2) { 338 335 ret = readable(s, res1, &info1); ··· 352 347 struct resource *res1, *res2; 353 348 int a = -1, b = -1; 354 349 355 - res1 = claim_region(s, base, size/2, IORESOURCE_MEM, "cs memory probe"); 356 - res2 = claim_region(s, base + size/2, size/2, IORESOURCE_MEM, "cs memory probe"); 350 + res1 = claim_region(s, base, size/2, IORESOURCE_MEM, "PCMCIA memprobe"); 351 + res2 = claim_region(s, base + size/2, size/2, IORESOURCE_MEM, 352 + "PCMCIA memprobe"); 357 353 358 354 if (res1 && res2) { 359 355 a = checksum(s, res1); ··· 377 371 378 372 static int do_mem_probe(u_long base, u_long num, struct pcmcia_socket *s) 379 373 { 380 - struct socket_data *s_data = s->resource_data; 381 - u_long i, j, bad, fail, step; 374 + struct socket_data *s_data = s->resource_data; 375 + u_long i, j, bad, fail, step; 382 376 383 - dev_printk(KERN_INFO, &s->dev, "cs: memory probe 0x%06lx-0x%06lx:", 384 - base, base+num-1); 385 - bad = fail = 0; 386 - step = (num < 0x20000) ? 0x2000 : ((num>>4) & ~0x1fff); 387 - /* don't allow too large steps */ 388 - if (step > 0x800000) 389 - step = 0x800000; 390 - /* cis_readable wants to map 2x map_size */ 391 - if (step < 2 * s->map_size) 392 - step = 2 * s->map_size; 393 - for (i = j = base; i < base+num; i = j + step) { 394 - if (!fail) { 395 - for (j = i; j < base+num; j += step) { 396 - if (cis_readable(s, j, step)) 397 - break; 398 - } 399 - fail = ((i == base) && (j == base+num)); 377 + dev_printk(KERN_INFO, &s->dev, "cs: memory probe 0x%06lx-0x%06lx:", 378 + base, base+num-1); 379 + bad = fail = 0; 380 + step = (num < 0x20000) ? 0x2000 : ((num>>4) & ~0x1fff); 381 + /* don't allow too large steps */ 382 + if (step > 0x800000) 383 + step = 0x800000; 384 + /* cis_readable wants to map 2x map_size */ 385 + if (step < 2 * s->map_size) 386 + step = 2 * s->map_size; 387 + for (i = j = base; i < base+num; i = j + step) { 388 + if (!fail) { 389 + for (j = i; j < base+num; j += step) { 390 + if (cis_readable(s, j, step)) 391 + break; 392 + } 393 + fail = ((i == base) && (j == base+num)); 394 + } 395 + if (fail) { 396 + for (j = i; j < base+num; j += 2*step) 397 + if (checksum_match(s, j, step) && 398 + checksum_match(s, j + step, step)) 399 + break; 400 + } 401 + if (i != j) { 402 + if (!bad) 403 + printk(" excluding"); 404 + printk(" %#05lx-%#05lx", i, j-1); 405 + sub_interval(&s_data->mem_db, i, j-i); 406 + bad += j-i; 407 + } 400 408 } 401 - if (fail) { 402 - for (j = i; j < base+num; j += 2*step) 403 - if (checksum_match(s, j, step) && 404 - checksum_match(s, j + step, step)) 405 - break; 406 - } 407 - if (i != j) { 408 - if (!bad) printk(" excluding"); 409 - printk(" %#05lx-%#05lx", i, j-1); 410 - sub_interval(&s_data->mem_db, i, j-i); 411 - bad += j-i; 412 - } 413 - } 414 - printk(bad ? "\n" : " clean.\n"); 415 - return (num - bad); 409 + printk(bad ? "\n" : " clean.\n"); 410 + return num - bad; 416 411 } 417 412 418 413 #ifdef CONFIG_PCMCIA_PROBE ··· 663 656 return res; 664 657 } 665 658 666 - static struct resource * nonstatic_find_mem_region(u_long base, u_long num, 659 + static struct resource *nonstatic_find_mem_region(u_long base, u_long num, 667 660 u_long align, int low, struct pcmcia_socket *s) 668 661 { 669 662 struct resource *res = make_resource(0, num, IORESOURCE_MEM, dev_name(&s->dev)); ··· 801 794 return -EINVAL; 802 795 #endif 803 796 804 - for (i=0; i < PCI_BUS_NUM_RESOURCES; i++) { 797 + for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) { 805 798 res = s->cb_dev->bus->resource[i]; 806 799 if (!res) 807 800 continue; ··· 915 908 for (p = data->io_db.next; p != &data->io_db; p = p->next) { 916 909 if (ret > (PAGE_SIZE - 10)) 917 910 continue; 918 - ret += snprintf (&buf[ret], (PAGE_SIZE - ret - 1), 919 - "0x%08lx - 0x%08lx\n", 920 - ((unsigned long) p->base), 921 - ((unsigned long) p->base + p->num - 1)); 911 + ret += snprintf(&buf[ret], (PAGE_SIZE - ret - 1), 912 + "0x%08lx - 0x%08lx\n", 913 + ((unsigned long) p->base), 914 + ((unsigned long) p->base + p->num - 1)); 922 915 } 923 916 924 917 mutex_unlock(&rsrc_mutex); 925 - return (ret); 918 + return ret; 926 919 } 927 920 928 921 static ssize_t store_io_db(struct device *dev, ··· 934 927 unsigned int add = ADD_MANAGED_RESOURCE; 935 928 ssize_t ret = 0; 936 929 937 - ret = sscanf (buf, "+ 0x%lx - 0x%lx", &start_addr, &end_addr); 930 + ret = sscanf(buf, "+ 0x%lx - 0x%lx", &start_addr, &end_addr); 938 931 if (ret != 2) { 939 - ret = sscanf (buf, "- 0x%lx - 0x%lx", &start_addr, &end_addr); 932 + ret = sscanf(buf, "- 0x%lx - 0x%lx", &start_addr, &end_addr); 940 933 add = REMOVE_MANAGED_RESOURCE; 941 934 if (ret != 2) { 942 - ret = sscanf (buf, "0x%lx - 0x%lx", &start_addr, &end_addr); 935 + ret = sscanf(buf, "0x%lx - 0x%lx", &start_addr, 936 + &end_addr); 943 937 add = ADD_MANAGED_RESOURCE; 944 938 if (ret != 2) 945 939 return -EINVAL; ··· 971 963 for (p = data->mem_db.next; p != &data->mem_db; p = p->next) { 972 964 if (ret > (PAGE_SIZE - 10)) 973 965 continue; 974 - ret += snprintf (&buf[ret], (PAGE_SIZE - ret - 1), 975 - "0x%08lx - 0x%08lx\n", 976 - ((unsigned long) p->base), 977 - ((unsigned long) p->base + p->num - 1)); 966 + ret += snprintf(&buf[ret], (PAGE_SIZE - ret - 1), 967 + "0x%08lx - 0x%08lx\n", 968 + ((unsigned long) p->base), 969 + ((unsigned long) p->base + p->num - 1)); 978 970 } 979 971 980 972 mutex_unlock(&rsrc_mutex); 981 - return (ret); 973 + return ret; 982 974 } 983 975 984 976 static ssize_t store_mem_db(struct device *dev, ··· 990 982 unsigned int add = ADD_MANAGED_RESOURCE; 991 983 ssize_t ret = 0; 992 984 993 - ret = sscanf (buf, "+ 0x%lx - 0x%lx", &start_addr, &end_addr); 985 + ret = sscanf(buf, "+ 0x%lx - 0x%lx", &start_addr, &end_addr); 994 986 if (ret != 2) { 995 - ret = sscanf (buf, "- 0x%lx - 0x%lx", &start_addr, &end_addr); 987 + ret = sscanf(buf, "- 0x%lx - 0x%lx", &start_addr, &end_addr); 996 988 add = REMOVE_MANAGED_RESOURCE; 997 989 if (ret != 2) { 998 - ret = sscanf (buf, "0x%lx - 0x%lx", &start_addr, &end_addr); 990 + ret = sscanf(buf, "0x%lx - 0x%lx", &start_addr, 991 + &end_addr); 999 992 add = ADD_MANAGED_RESOURCE; 1000 993 if (ret != 2) 1001 994 return -EINVAL;
+3 -3
drivers/pcmcia/socket_sysfs.c
··· 164 164 if (!count) 165 165 return -EINVAL; 166 166 167 - ret = sscanf (buf, "0x%x\n", &mask); 167 + ret = sscanf(buf, "0x%x\n", &mask); 168 168 169 169 if (ret == 1) { 170 170 s->irq_mask &= mask; ··· 278 278 free_tuple: 279 279 kfree(tuplebuffer); 280 280 281 - return (ret); 281 + return ret; 282 282 } 283 283 284 284 static ssize_t pccard_show_cis(struct kobject *kobj, ··· 308 308 count = pccard_extract_cis(s, buf, off, count); 309 309 } 310 310 311 - return (count); 311 + return count; 312 312 } 313 313 314 314 static ssize_t pccard_store_cis(struct kobject *kobj,
+96 -51
drivers/pcmcia/yenta_socket.c
··· 6 6 * Changelog: 7 7 * Aug 2002: Manfred Spraul <manfred@colorfullife.com> 8 8 * Dynamically adjust the size of the bridge resource 9 - * 9 + * 10 10 * May 2003: Dominik Brodowski <linux@brodo.de> 11 11 * Merge pci_socket.c and yenta.c into one file 12 12 */ ··· 16 16 #include <linux/interrupt.h> 17 17 #include <linux/delay.h> 18 18 #include <linux/module.h> 19 + #include <linux/io.h> 19 20 20 21 #include <pcmcia/cs_types.h> 21 22 #include <pcmcia/ss.h> 22 23 #include <pcmcia/cs.h> 23 - 24 - #include <asm/io.h> 25 24 26 25 #include "yenta_socket.h" 27 26 #include "i82365.h" ··· 54 55 55 56 static unsigned int override_bios; 56 57 module_param(override_bios, uint, 0000); 57 - MODULE_PARM_DESC (override_bios, "yenta ignore bios resource allocation"); 58 + MODULE_PARM_DESC(override_bios, "yenta ignore bios resource allocation"); 58 59 59 60 /* 60 61 * Generate easy-to-use ways of reading a cardbus sockets ··· 236 237 /* i82365SL-DF style */ 237 238 if (socket->flags & YENTA_16BIT_POWER_DF) { 238 239 switch (state->Vcc) { 239 - case 33: reg |= I365_VCC_3V; break; 240 - case 50: reg |= I365_VCC_5V; break; 241 - default: reg = 0; break; 240 + case 33: 241 + reg |= I365_VCC_3V; 242 + break; 243 + case 50: 244 + reg |= I365_VCC_5V; 245 + break; 246 + default: 247 + reg = 0; 248 + break; 242 249 } 243 250 switch (state->Vpp) { 244 251 case 33: 245 - case 50: reg |= I365_VPP1_5V; break; 246 - case 120: reg |= I365_VPP1_12V; break; 252 + case 50: 253 + reg |= I365_VPP1_5V; 254 + break; 255 + case 120: 256 + reg |= I365_VPP1_12V; 257 + break; 247 258 } 248 259 } else { 249 260 /* i82365SL-B style */ 250 261 switch (state->Vcc) { 251 - case 50: reg |= I365_VCC_5V; break; 252 - default: reg = 0; break; 262 + case 50: 263 + reg |= I365_VCC_5V; 264 + break; 265 + default: 266 + reg = 0; 267 + break; 253 268 } 254 269 switch (state->Vpp) { 255 - case 50: reg |= I365_VPP1_5V | I365_VPP2_5V; break; 256 - case 120: reg |= I365_VPP1_12V | I365_VPP2_12V; break; 270 + case 50: 271 + reg |= I365_VPP1_5V | I365_VPP2_5V; 272 + break; 273 + case 120: 274 + reg |= I365_VPP1_12V | I365_VPP2_12V; 275 + break; 257 276 } 258 277 } 259 278 ··· 280 263 } else { 281 264 u32 reg = 0; /* CB_SC_STPCLK? */ 282 265 switch (state->Vcc) { 283 - case 33: reg = CB_SC_VCC_3V; break; 284 - case 50: reg = CB_SC_VCC_5V; break; 285 - default: reg = 0; break; 266 + case 33: 267 + reg = CB_SC_VCC_3V; 268 + break; 269 + case 50: 270 + reg = CB_SC_VCC_5V; 271 + break; 272 + default: 273 + reg = 0; 274 + break; 286 275 } 287 276 switch (state->Vpp) { 288 - case 33: reg |= CB_SC_VPP_3V; break; 289 - case 50: reg |= CB_SC_VPP_5V; break; 290 - case 120: reg |= CB_SC_VPP_12V; break; 277 + case 33: 278 + reg |= CB_SC_VPP_3V; 279 + break; 280 + case 50: 281 + reg |= CB_SC_VPP_5V; 282 + break; 283 + case 120: 284 + reg |= CB_SC_VPP_12V; 285 + break; 291 286 } 292 287 if (reg != cb_readl(socket, CB_SOCKET_CONTROL)) 293 288 cb_writel(socket, CB_SOCKET_CONTROL, reg); ··· 343 314 344 315 reg = exca_readb(socket, I365_POWER) & (I365_VCC_MASK|I365_VPP1_MASK); 345 316 reg |= I365_PWR_NORESET; 346 - if (state->flags & SS_PWR_AUTO) reg |= I365_PWR_AUTO; 347 - if (state->flags & SS_OUTPUT_ENA) reg |= I365_PWR_OUT; 317 + if (state->flags & SS_PWR_AUTO) 318 + reg |= I365_PWR_AUTO; 319 + if (state->flags & SS_OUTPUT_ENA) 320 + reg |= I365_PWR_OUT; 348 321 if (exca_readb(socket, I365_POWER) != reg) 349 322 exca_writeb(socket, I365_POWER, reg); 350 323 351 324 /* CSC interrupt: no ISA irq for CSC */ 352 325 reg = I365_CSC_DETECT; 353 326 if (state->flags & SS_IOCARD) { 354 - if (state->csc_mask & SS_STSCHG) reg |= I365_CSC_STSCHG; 327 + if (state->csc_mask & SS_STSCHG) 328 + reg |= I365_CSC_STSCHG; 355 329 } else { 356 - if (state->csc_mask & SS_BATDEAD) reg |= I365_CSC_BVD1; 357 - if (state->csc_mask & SS_BATWARN) reg |= I365_CSC_BVD2; 358 - if (state->csc_mask & SS_READY) reg |= I365_CSC_READY; 330 + if (state->csc_mask & SS_BATDEAD) 331 + reg |= I365_CSC_BVD1; 332 + if (state->csc_mask & SS_BATWARN) 333 + reg |= I365_CSC_BVD2; 334 + if (state->csc_mask & SS_READY) 335 + reg |= I365_CSC_READY; 359 336 } 360 337 exca_writeb(socket, I365_CSCINT, reg); 361 338 exca_readb(socket, I365_CSC); 362 - if(sock->zoom_video) 339 + if (sock->zoom_video) 363 340 sock->zoom_video(sock, state->flags & SS_ZVCARD); 364 341 } 365 342 config_writew(socket, CB_BRIDGE_CONTROL, bridge); ··· 403 368 exca_writew(socket, I365_IO(map)+I365_W_STOP, io->stop); 404 369 405 370 ioctl = exca_readb(socket, I365_IOCTL) & ~I365_IOCTL_MASK(map); 406 - if (io->flags & MAP_0WS) ioctl |= I365_IOCTL_0WS(map); 407 - if (io->flags & MAP_16BIT) ioctl |= I365_IOCTL_16BIT(map); 408 - if (io->flags & MAP_AUTOSZ) ioctl |= I365_IOCTL_IOCS16(map); 371 + if (io->flags & MAP_0WS) 372 + ioctl |= I365_IOCTL_0WS(map); 373 + if (io->flags & MAP_16BIT) 374 + ioctl |= I365_IOCTL_16BIT(map); 375 + if (io->flags & MAP_AUTOSZ) 376 + ioctl |= I365_IOCTL_IOCS16(map); 409 377 exca_writeb(socket, I365_IOCTL, ioctl); 410 378 411 379 if (io->flags & MAP_ACTIVE) ··· 454 416 455 417 word = (stop >> 12) & 0x0fff; 456 418 switch (to_cycles(mem->speed)) { 457 - case 0: break; 458 - case 1: word |= I365_MEM_WS0; break; 459 - case 2: word |= I365_MEM_WS1; break; 460 - default: word |= I365_MEM_WS1 | I365_MEM_WS0; break; 419 + case 0: 420 + break; 421 + case 1: 422 + word |= I365_MEM_WS0; 423 + break; 424 + case 2: 425 + word |= I365_MEM_WS1; 426 + break; 427 + default: 428 + word |= I365_MEM_WS1 | I365_MEM_WS0; 429 + break; 461 430 } 462 431 exca_writew(socket, I365_MEM(map) + I365_W_STOP, word); 463 432 ··· 592 547 * max 4 MB, min 16 kB. We try very hard to not get below 593 548 * the "ACC" values, though. 594 549 */ 595 - #define BRIDGE_MEM_MAX 4*1024*1024 596 - #define BRIDGE_MEM_ACC 128*1024 597 - #define BRIDGE_MEM_MIN 16*1024 550 + #define BRIDGE_MEM_MAX (4*1024*1024) 551 + #define BRIDGE_MEM_ACC (128*1024) 552 + #define BRIDGE_MEM_MIN (16*1024) 598 553 599 554 #define BRIDGE_IO_MAX 512 600 555 #define BRIDGE_IO_ACC 256 ··· 619 574 int i; 620 575 size = BRIDGE_MEM_MAX; 621 576 if (size > avail/8) { 622 - size=(avail+1)/8; 577 + size = (avail+1)/8; 623 578 /* round size down to next power of 2 */ 624 579 i = 0; 625 580 while ((size /= 2) != 0) ··· 635 590 636 591 do { 637 592 if (allocate_resource(root, res, size, start, end, align, 638 - NULL, NULL)==0) { 593 + NULL, NULL) == 0) { 639 594 return 1; 640 595 } 641 596 size = size/2; ··· 650 605 u32 min) 651 606 { 652 607 int i; 653 - for (i=0; i<PCI_BUS_NUM_RESOURCES; i++) { 654 - struct resource * root = socket->dev->bus->resource[i]; 608 + for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) { 609 + struct resource *root = socket->dev->bus->resource[i]; 655 610 if (!root) 656 611 continue; 657 612 ··· 749 704 static void yenta_free_resources(struct yenta_socket *socket) 750 705 { 751 706 int i; 752 - for (i=0;i<4;i++) { 707 + for (i = 0; i < 4; i++) { 753 708 struct resource *res; 754 709 res = socket->dev->resource + PCI_BRIDGE_RESOURCES + i; 755 710 if (res->start != 0 && res->end != 0) ··· 771 726 772 727 /* we don't want a dying socket registered */ 773 728 pcmcia_unregister_socket(&sock->socket); 774 - 729 + 775 730 /* Disable all events so we don't die in an IRQ storm */ 776 731 cb_writel(sock, CB_SOCKET_MASK, 0x0); 777 732 exca_writeb(sock, I365_CSCINT, 0); ··· 943 898 { 944 899 struct yenta_socket *socket = (struct yenta_socket *) dev_id; 945 900 u8 csc; 946 - u32 cb_event; 901 + u32 cb_event; 947 902 948 903 /* Clear interrupt status for the event */ 949 904 cb_event = cb_readl(socket, CB_SOCKET_EVENT); ··· 1064 1019 { 1065 1020 struct list_head *tmp; 1066 1021 unsigned char upper_limit; 1067 - /* 1022 + /* 1068 1023 * We only check and fix the parent bridge: All systems which need 1069 1024 * this fixup that have been reviewed are laptops and the only bridge 1070 1025 * which needed fixing was the parent bridge of the CardBus bridge: ··· 1083 1038 1084 1039 /* check the bus ranges of all silbling bridges to prevent overlap */ 1085 1040 list_for_each(tmp, &bridge_to_fix->parent->children) { 1086 - struct pci_bus * silbling = pci_bus_b(tmp); 1041 + struct pci_bus *silbling = pci_bus_b(tmp); 1087 1042 /* 1088 1043 * If the silbling has a higher secondary bus number 1089 1044 * and it's secondary is equal or smaller than our ··· 1128 1083 * interrupt, and that we can map the cardbus area. Fill in the 1129 1084 * socket information structure.. 1130 1085 */ 1131 - static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_id *id) 1086 + static int __devinit yenta_probe(struct pci_dev *dev, const struct pci_device_id *id) 1132 1087 { 1133 1088 struct yenta_socket *socket; 1134 1089 int ret; ··· 1347 1302 #define YENTA_PM_OPS NULL 1348 1303 #endif 1349 1304 1350 - #define CB_ID(vend,dev,type) \ 1305 + #define CB_ID(vend, dev, type) \ 1351 1306 { \ 1352 1307 .vendor = vend, \ 1353 1308 .device = dev, \ ··· 1358 1313 .driver_data = CARDBUS_TYPE_##type, \ 1359 1314 } 1360 1315 1361 - static struct pci_device_id yenta_table [] = { 1316 + static struct pci_device_id yenta_table[] = { 1362 1317 CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1031, TI), 1363 1318 1364 1319 /* ··· 1448 1403 1449 1404 static int __init yenta_socket_init(void) 1450 1405 { 1451 - return pci_register_driver (&yenta_cardbus_driver); 1406 + return pci_register_driver(&yenta_cardbus_driver); 1452 1407 } 1453 1408 1454 1409 1455 - static void __exit yenta_socket_exit (void) 1410 + static void __exit yenta_socket_exit(void) 1456 1411 { 1457 - pci_unregister_driver (&yenta_cardbus_driver); 1412 + pci_unregister_driver(&yenta_cardbus_driver); 1458 1413 } 1459 1414 1460 1415
+3 -3
include/pcmcia/ds.h
··· 82 82 /* the hardware "function" device; certain subdevices can 83 83 * share one hardware "function" device. */ 84 84 u8 func; 85 - struct config_t* function_config; 85 + struct config_t *function_config; 86 86 87 87 struct list_head socket_device_list; 88 88 ··· 121 121 u16 manf_id; 122 122 u16 card_id; 123 123 124 - char * prod_id[4]; 124 + char *prod_id[4]; 125 125 126 126 u64 dma_mask; 127 127 struct device dev; 128 128 129 129 #ifdef CONFIG_PCMCIA_IOCTL 130 130 /* device driver wanted by cardmgr */ 131 - struct pcmcia_driver * cardmgr; 131 + struct pcmcia_driver *cardmgr; 132 132 #endif 133 133 134 134 /* data private to drivers */
+1 -1
include/pcmcia/mem_op.h
··· 15 15 #ifndef _LINUX_MEM_OP_H 16 16 #define _LINUX_MEM_OP_H 17 17 18 + #include <linux/io.h> 18 19 #include <asm/uaccess.h> 19 - #include <asm/io.h> 20 20 21 21 /* 22 22 If UNSAFE_MEMCPY is defined, we use the (optimized) system routines
+6 -6
include/pcmcia/ss.h
··· 154 154 struct list_head socket_list; 155 155 struct completion socket_released; 156 156 157 - /* deprecated */ 157 + /* deprecated */ 158 158 unsigned int sock; /* socket number */ 159 159 160 160 ··· 164 164 u_int map_size; 165 165 u_int io_offset; 166 166 u_int pci_irq; 167 - struct pci_dev * cb_dev; 167 + struct pci_dev *cb_dev; 168 168 169 169 170 170 /* socket setup is done so resources should be able to be allocated. ··· 179 179 u8 reserved:5; 180 180 181 181 /* socket operations */ 182 - struct pccard_operations * ops; 183 - struct pccard_resource_ops * resource_ops; 184 - void * resource_data; 182 + struct pccard_operations *ops; 183 + struct pccard_resource_ops *resource_ops; 184 + void *resource_data; 185 185 186 186 /* Zoom video behaviour is so chip specific its not worth adding 187 187 this to _ops */ ··· 245 245 246 246 /* cardbus (32-bit) */ 247 247 #ifdef CONFIG_CARDBUS 248 - struct resource * cb_cis_res; 248 + struct resource *cb_cis_res; 249 249 void __iomem *cb_cis_virt; 250 250 #endif /* CONFIG_CARDBUS */ 251 251