Commit fb1beb29b5c531b12485d7c32174a77120590481

Authored by Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6:
  pcmcia: CodingStyle fixes
  pcmcia: remove unused IRQ_FIRST_SHARED

Showing 26 changed files Side-by-side Diff

drivers/isdn/hardware/avm/avm_cs.c
... ... @@ -108,8 +108,7 @@
108 108 p_dev->io.NumPorts2 = 0;
109 109  
110 110 /* Interrupt setup */
111   - p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
112   - p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
  111 + p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
113 112  
114 113 /* General socket configuration */
115 114 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
drivers/isdn/hisax/avma1_cs.c
... ... @@ -120,8 +120,7 @@
120 120 p_dev->io.IOAddrLines = 5;
121 121  
122 122 /* Interrupt setup */
123   - p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
124   - p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
  123 + p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
125 124  
126 125 /* General socket configuration */
127 126 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
drivers/isdn/hisax/elsa_cs.c
... ... @@ -137,7 +137,7 @@
137 137 local->cardnr = -1;
138 138  
139 139 /* Interrupt setup */
140   - link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
  140 + link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
141 141 link->irq.Handler = NULL;
142 142  
143 143 /*
drivers/isdn/hisax/sedlbauer_cs.c
... ... @@ -144,7 +144,7 @@
144 144 link->priv = local;
145 145  
146 146 /* Interrupt setup */
147   - link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
  147 + link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
148 148 link->irq.Handler = NULL;
149 149  
150 150 /*
drivers/isdn/hisax/teles_cs.c
... ... @@ -127,7 +127,7 @@
127 127 link->priv = local;
128 128  
129 129 /* Interrupt setup */
130   - link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
  130 + link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
131 131 link->irq.Handler = NULL;
132 132  
133 133 /*
drivers/net/pcmcia/axnet_cs.c
... ... @@ -270,7 +270,7 @@
270 270 /* for master/slave multifunction cards */
271 271 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
272 272 link->irq.Attributes =
273   - IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
  273 + IRQ_TYPE_DYNAMIC_SHARING;
274 274 }
275 275 } else {
276 276 /* This should be two 16-port windows */
drivers/net/pcmcia/fmvj18x_cs.c
... ... @@ -426,7 +426,7 @@
426 426  
427 427 if (link->io.NumPorts2 != 0) {
428 428 link->irq.Attributes =
429   - IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
  429 + IRQ_TYPE_DYNAMIC_SHARING;
430 430 ret = mfc_try_io_port(link);
431 431 if (ret != 0) goto failed;
432 432 } else if (cardtype == UNGERMANN) {
drivers/net/pcmcia/pcnet_cs.c
... ... @@ -490,7 +490,7 @@
490 490 /* for master/slave multifunction cards */
491 491 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
492 492 link->irq.Attributes =
493   - IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
  493 + IRQ_TYPE_DYNAMIC_SHARING;
494 494 }
495 495 } else {
496 496 /* This should be two 16-port windows */
drivers/net/pcmcia/smc91c92_cs.c
... ... @@ -454,7 +454,7 @@
454 454 link->conf.Attributes |= CONF_ENABLE_SPKR;
455 455 link->conf.Status = CCSR_AUDIO_ENA;
456 456 link->irq.Attributes =
457   - IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
  457 + IRQ_TYPE_DYNAMIC_SHARING;
458 458 link->io.IOAddrLines = 16;
459 459 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
460 460 link->io.NumPorts2 = 8;
drivers/net/pcmcia/xirc2ps_cs.c
... ... @@ -841,7 +841,7 @@
841 841 link->conf.Attributes |= CONF_ENABLE_SPKR;
842 842 link->conf.Status |= CCSR_AUDIO_ENA;
843 843 }
844   - link->irq.Attributes |= IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED ;
  844 + link->irq.Attributes |= IRQ_TYPE_DYNAMIC_SHARING;
845 845 link->io.NumPorts2 = 8;
846 846 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
847 847 if (local->dingo) {
drivers/pcmcia/Kconfig
... ... @@ -64,7 +64,7 @@
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,8 +87,8 @@
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
drivers/pcmcia/cardbus.c
... ... @@ -27,8 +27,8 @@
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,7 +58,7 @@
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)
65 65  
... ... @@ -85,10 +85,10 @@
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,7 +98,7 @@
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  
105 105  
... ... @@ -124,10 +124,11 @@
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;
... ... @@ -181,7 +182,7 @@
181 182 cb_alloc() and cb_free() allocate and free the kernel data
182 183 structures for a Cardbus device, and handle the lowest level PCI
183 184 device setup issues.
184   -
  185 +
185 186 =====================================================================*/
186 187  
187 188 static void cardbus_config_irq_and_cls(struct pci_bus *bus, int irq)
188 189  
... ... @@ -214,14 +215,14 @@
214 215 }
215 216 }
216 217  
217   -int __ref cb_alloc(struct pcmcia_socket * s)
  218 +int __ref cb_alloc(struct pcmcia_socket *s)
218 219 {
219 220 struct pci_bus *bus = s->cb_dev->subordinate;
220 221 struct pci_dev *dev;
221 222 unsigned int max, pass;
222 223  
223 224 s->functions = pci_scan_slot(bus, PCI_DEVFN(0, 0));
224   -// pcibios_fixup_bus(bus);
  225 +/* pcibios_fixup_bus(bus); */
225 226  
226 227 max = bus->secondary;
227 228 for (pass = 0; pass < 2; pass++)
... ... @@ -248,7 +249,7 @@
248 249 return 0;
249 250 }
250 251  
251   -void cb_free(struct pcmcia_socket * s)
  252 +void cb_free(struct pcmcia_socket *s)
252 253 {
253 254 struct pci_dev *bridge = s->cb_dev;
254 255  
drivers/pcmcia/cistpl.c
... ... @@ -23,7 +23,7 @@
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,7 +125,7 @@
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,7 +137,7 @@
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,7 +203,7 @@
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,7 +262,7 @@
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,7 +342,7 @@
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,7 +381,7 @@
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,7 +406,7 @@
406 406 /*======================================================================
407 407  
408 408 The high-level CIS tuple services
409   -
  409 +
410 410 ======================================================================*/
411 411  
412 412 typedef struct tuple_flags {
... ... @@ -421,8 +421,6 @@
421 421 #define MFC_FN(f) (((tuple_flags *)(&(f)))->mfc_fn)
422 422 #define SPACE(f) (((tuple_flags *)(&(f)))->space)
423 423  
424   -int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int func, tuple_t *tuple);
425   -
426 424 int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, tuple_t *tuple)
427 425 {
428 426 if (!s)
429 427  
... ... @@ -523,10 +521,11 @@
523 521 ofs++; continue;
524 522 }
525 523 }
526   -
  524 +
527 525 /* End of chain? Follow long link if possible */
528 526 if (link[0] == CISTPL_END) {
529   - if ((ofs = follow_link(s, tuple)) < 0)
  527 + ofs = follow_link(s, tuple);
  528 + if (ofs < 0)
530 529 return -ENOSPC;
531 530 attr = SPACE(tuple->Flags);
532 531 read_cis_cache(s, attr, ofs, 2, link);
... ... @@ -578,7 +577,7 @@
578 577 } else
579 578 if (tuple->DesiredTuple == RETURN_FIRST_TUPLE)
580 579 break;
581   -
  580 +
582 581 if (link[0] == tuple->DesiredTuple)
583 582 break;
584 583 ofs += link[1] + 2;
... ... @@ -587,7 +586,7 @@
587 586 dev_dbg(&s->dev, "cs: overrun in pcmcia_get_next_tuple\n");
588 587 return -ENOSPC;
589 588 }
590   -
  589 +
591 590 tuple->TupleCode = link[0];
592 591 tuple->TupleLink = link[1];
593 592 tuple->CISOffset = ofs + 2;
... ... @@ -623,7 +622,7 @@
623 622 /*======================================================================
624 623  
625 624 Parsing routines for individual tuples
626   -
  625 +
627 626 ======================================================================*/
628 627  
629 628 static int parse_device(tuple_t *tuple, cistpl_device_t *device)
630 629  
631 630  
632 631  
633 632  
... ... @@ -637,26 +636,37 @@
637 636  
638 637 device->ndev = 0;
639 638 for (i = 0; i < CISTPL_MAX_DEVICES; i++) {
640   -
641   - if (*p == 0xff) break;
  639 +
  640 + if (*p == 0xff)
  641 + break;
642 642 device->dev[i].type = (*p >> 4);
643 643 device->dev[i].wp = (*p & 0x08) ? 1 : 0;
644 644 switch (*p & 0x07) {
645   - case 0: device->dev[i].speed = 0; break;
646   - case 1: device->dev[i].speed = 250; break;
647   - case 2: device->dev[i].speed = 200; break;
648   - case 3: device->dev[i].speed = 150; break;
649   - case 4: device->dev[i].speed = 100; break;
  645 + case 0:
  646 + device->dev[i].speed = 0;
  647 + break;
  648 + case 1:
  649 + device->dev[i].speed = 250;
  650 + break;
  651 + case 2:
  652 + device->dev[i].speed = 200;
  653 + break;
  654 + case 3:
  655 + device->dev[i].speed = 150;
  656 + break;
  657 + case 4:
  658 + device->dev[i].speed = 100;
  659 + break;
650 660 case 7:
651   - if (++p == q)
652   - return -EINVAL;
653   - device->dev[i].speed = SPEED_CVT(*p);
654   - while (*p & 0x80)
655 661 if (++p == q)
656 662 return -EINVAL;
657   - break;
  663 + device->dev[i].speed = SPEED_CVT(*p);
  664 + while (*p & 0x80)
  665 + if (++p == q)
  666 + return -EINVAL;
  667 + break;
658 668 default:
659   - return -EINVAL;
  669 + return -EINVAL;
660 670 }
661 671  
662 672 if (++p == q)
... ... @@ -671,7 +681,7 @@
671 681 if (++p == q)
672 682 break;
673 683 }
674   -
  684 +
675 685 return 0;
676 686 }
677 687  
678 688  
... ... @@ -706,9 +716,9 @@
706 716 {
707 717 u_char *p;
708 718 int i;
709   -
  719 +
710 720 p = (u_char *)tuple->TupleData;
711   -
  721 +
712 722 link->nfn = *p; p++;
713 723 if (tuple->TupleDataLen <= link->nfn*5)
714 724 return -EINVAL;
715 725  
... ... @@ -737,11 +747,13 @@
737 747 ns++;
738 748 for (;;) {
739 749 s[j++] = (*p == 0xff) ? '\0' : *p;
740   - if ((*p == '\0') || (*p == 0xff)) break;
  750 + if ((*p == '\0') || (*p == 0xff))
  751 + break;
741 752 if (++p == q)
742 753 return -EINVAL;
743 754 }
744   - if ((*p == 0xff) || (++p == q)) break;
  755 + if ((*p == 0xff) || (++p == q))
  756 + break;
745 757 }
746 758 if (found) {
747 759 *found = ns;
748 760  
... ... @@ -756,10 +768,10 @@
756 768 static int parse_vers_1(tuple_t *tuple, cistpl_vers_1_t *vers_1)
757 769 {
758 770 u_char *p, *q;
759   -
  771 +
760 772 p = (u_char *)tuple->TupleData;
761 773 q = p + tuple->TupleDataLen;
762   -
  774 +
763 775 vers_1->major = *p; p++;
764 776 vers_1->minor = *p; p++;
765 777 if (p >= q)
766 778  
... ... @@ -774,10 +786,10 @@
774 786 static int parse_altstr(tuple_t *tuple, cistpl_altstr_t *altstr)
775 787 {
776 788 u_char *p, *q;
777   -
  789 +
778 790 p = (u_char *)tuple->TupleData;
779 791 q = p + tuple->TupleDataLen;
780   -
  792 +
781 793 return parse_strings(p, q, CISTPL_MAX_ALTSTR_STRINGS,
782 794 altstr->str, altstr->ofs, &altstr->ns);
783 795 }
... ... @@ -793,7 +805,8 @@
793 805 q = p + tuple->TupleDataLen;
794 806  
795 807 for (nid = 0; nid < CISTPL_MAX_DEVICES; nid++) {
796   - if (p > q-2) break;
  808 + if (p > q-2)
  809 + break;
797 810 jedec->id[nid].mfr = p[0];
798 811 jedec->id[nid].info = p[1];
799 812 p += 2;
... ... @@ -871,7 +884,7 @@
871 884  
872 885 The following routines are all used to parse the nightmarish
873 886 config table entries.
874   -
  887 +
875 888 ======================================================================*/
876 889  
877 890 static u_char *parse_power(u_char *p, u_char *q,
878 891  
879 892  
... ... @@ -880,17 +893,20 @@
880 893 int i;
881 894 u_int scale;
882 895  
883   - if (p == q) return NULL;
  896 + if (p == q)
  897 + return NULL;
884 898 pwr->present = *p;
885 899 pwr->flags = 0;
886 900 p++;
887 901 for (i = 0; i < 7; i++)
888 902 if (pwr->present & (1<<i)) {
889   - if (p == q) return NULL;
  903 + if (p == q)
  904 + return NULL;
890 905 pwr->param[i] = POWER_CVT(*p);
891 906 scale = POWER_SCALE(*p);
892 907 while (*p & 0x80) {
893   - if (++p == q) return NULL;
  908 + if (++p == q)
  909 + return NULL;
894 910 if ((*p & 0x7f) < 100)
895 911 pwr->param[i] += (*p & 0x7f) * scale / 100;
896 912 else if (*p == 0x7d)
897 913  
898 914  
899 915  
... ... @@ -914,24 +930,28 @@
914 930 {
915 931 u_char scale;
916 932  
917   - if (p == q) return NULL;
  933 + if (p == q)
  934 + return NULL;
918 935 scale = *p;
919 936 if ((scale & 3) != 3) {
920   - if (++p == q) return NULL;
  937 + if (++p == q)
  938 + return NULL;
921 939 timing->wait = SPEED_CVT(*p);
922 940 timing->waitscale = exponent[scale & 3];
923 941 } else
924 942 timing->wait = 0;
925 943 scale >>= 2;
926 944 if ((scale & 7) != 7) {
927   - if (++p == q) return NULL;
  945 + if (++p == q)
  946 + return NULL;
928 947 timing->ready = SPEED_CVT(*p);
929 948 timing->rdyscale = exponent[scale & 7];
930 949 } else
931 950 timing->ready = 0;
932 951 scale >>= 3;
933 952 if (scale != 7) {
934   - if (++p == q) return NULL;
  953 + if (++p == q)
  954 + return NULL;
935 955 timing->reserved = SPEED_CVT(*p);
936 956 timing->rsvscale = exponent[scale];
937 957 } else
... ... @@ -946,7 +966,8 @@
946 966 {
947 967 int i, j, bsz, lsz;
948 968  
949   - if (p == q) return NULL;
  969 + if (p == q)
  970 + return NULL;
950 971 io->flags = *p;
951 972  
952 973 if (!(*p & 0x80)) {
953 974  
954 975  
955 976  
956 977  
957 978  
... ... @@ -955,24 +976,29 @@
955 976 io->win[0].len = (1 << (io->flags & CISTPL_IO_LINES_MASK));
956 977 return p+1;
957 978 }
958   -
959   - if (++p == q) return NULL;
  979 +
  980 + if (++p == q)
  981 + return NULL;
960 982 io->nwin = (*p & 0x0f) + 1;
961 983 bsz = (*p & 0x30) >> 4;
962   - if (bsz == 3) bsz++;
  984 + if (bsz == 3)
  985 + bsz++;
963 986 lsz = (*p & 0xc0) >> 6;
964   - if (lsz == 3) lsz++;
  987 + if (lsz == 3)
  988 + lsz++;
965 989 p++;
966   -
  990 +
967 991 for (i = 0; i < io->nwin; i++) {
968 992 io->win[i].base = 0;
969 993 io->win[i].len = 1;
970 994 for (j = 0; j < bsz; j++, p++) {
971   - if (p == q) return NULL;
  995 + if (p == q)
  996 + return NULL;
972 997 io->win[i].base += *p << (j*8);
973 998 }
974 999 for (j = 0; j < lsz; j++, p++) {
975   - if (p == q) return NULL;
  1000 + if (p == q)
  1001 + return NULL;
976 1002 io->win[i].len += *p << (j*8);
977 1003 }
978 1004 }
979 1005  
980 1006  
981 1007  
982 1008  
... ... @@ -986,27 +1012,32 @@
986 1012 int i, j, asz, lsz, has_ha;
987 1013 u_int len, ca, ha;
988 1014  
989   - if (p == q) return NULL;
  1015 + if (p == q)
  1016 + return NULL;
990 1017  
991 1018 mem->nwin = (*p & 0x07) + 1;
992 1019 lsz = (*p & 0x18) >> 3;
993 1020 asz = (*p & 0x60) >> 5;
994 1021 has_ha = (*p & 0x80);
995   - if (++p == q) return NULL;
996   -
  1022 + if (++p == q)
  1023 + return NULL;
  1024 +
997 1025 for (i = 0; i < mem->nwin; i++) {
998 1026 len = ca = ha = 0;
999 1027 for (j = 0; j < lsz; j++, p++) {
1000   - if (p == q) return NULL;
  1028 + if (p == q)
  1029 + return NULL;
1001 1030 len += *p << (j*8);
1002 1031 }
1003 1032 for (j = 0; j < asz; j++, p++) {
1004   - if (p == q) return NULL;
  1033 + if (p == q)
  1034 + return NULL;
1005 1035 ca += *p << (j*8);
1006 1036 }
1007 1037 if (has_ha)
1008 1038 for (j = 0; j < asz; j++, p++) {
1009   - if (p == q) return NULL;
  1039 + if (p == q)
  1040 + return NULL;
1010 1041 ha += *p << (j*8);
1011 1042 }
1012 1043 mem->win[i].len = len << 8;
... ... @@ -1095,7 +1126,7 @@
1095 1126 entry->timing.ready = 0;
1096 1127 entry->timing.reserved = 0;
1097 1128 }
1098   -
  1129 +
1099 1130 /* I/O window options */
1100 1131 if (features & 0x08) {
1101 1132 p = parse_io(p, q, &entry->io);
... ... @@ -1103,7 +1134,7 @@
1103 1134 return -EINVAL;
1104 1135 } else
1105 1136 entry->io.nwin = 0;
1106   -
  1137 +
1107 1138 /* Interrupt options */
1108 1139 if (features & 0x10) {
1109 1140 p = parse_irq(p, q, &entry->irq);
... ... @@ -1153,7 +1184,7 @@
1153 1184 }
1154 1185  
1155 1186 entry->subtuples = q-p;
1156   -
  1187 +
1157 1188 return 0;
1158 1189 }
1159 1190  
... ... @@ -1176,7 +1207,7 @@
1176 1207 static int parse_config_cb(tuple_t *tuple, cistpl_config_t *config)
1177 1208 {
1178 1209 u_char *p;
1179   -
  1210 +
1180 1211 p = (u_char *)tuple->TupleData;
1181 1212 if ((*p != 3) || (tuple->TupleDataLen < 6))
1182 1213 return -EINVAL;
... ... @@ -1231,7 +1262,7 @@
1231 1262 entry->io = *p; p++;
1232 1263 } else
1233 1264 entry->io = 0;
1234   -
  1265 +
1235 1266 /* Interrupt options */
1236 1267 if (features & 0x10) {
1237 1268 p = parse_irq(p, q, &entry->irq);
... ... @@ -1264,7 +1295,7 @@
1264 1295 }
1265 1296  
1266 1297 entry->subtuples = q-p;
1267   -
  1298 +
1268 1299 return 0;
1269 1300 }
1270 1301  
... ... @@ -1281,7 +1312,8 @@
1281 1312 q = p + tuple->TupleDataLen;
1282 1313  
1283 1314 for (n = 0; n < CISTPL_MAX_DEVICES; n++) {
1284   - if (p > q-6) break;
  1315 + if (p > q-6)
  1316 + break;
1285 1317 geo->geo[n].buswidth = p[0];
1286 1318 geo->geo[n].erase_block = 1 << (p[1]-1);
1287 1319 geo->geo[n].read_block = 1 << (p[2]-1);
1288 1320  
... ... @@ -1302,13 +1334,13 @@
1302 1334  
1303 1335 if (tuple->TupleDataLen < 10)
1304 1336 return -EINVAL;
1305   -
  1337 +
1306 1338 p = tuple->TupleData;
1307 1339 q = p + tuple->TupleDataLen;
1308 1340  
1309 1341 v2->vers = p[0];
1310 1342 v2->comply = p[1];
1311   - v2->dindex = get_unaligned_le16(p +2 );
  1343 + v2->dindex = get_unaligned_le16(p + 2);
1312 1344 v2->vspec8 = p[6];
1313 1345 v2->vspec9 = p[7];
1314 1346 v2->nhdr = p[8];
... ... @@ -1322,7 +1354,7 @@
1322 1354 {
1323 1355 u_char *p, *q;
1324 1356 int i;
1325   -
  1357 +
1326 1358 p = tuple->TupleData;
1327 1359 q = p + tuple->TupleDataLen;
1328 1360 if (p == q)
... ... @@ -1332,7 +1364,8 @@
1332 1364 return -EINVAL;
1333 1365 for (i = 0; i < 30; i++) {
1334 1366 org->desc[i] = *p;
1335   - if (*p == '\0') break;
  1367 + if (*p == '\0')
  1368 + break;
1336 1369 if (++p == q)
1337 1370 return -EINVAL;
1338 1371 }
... ... @@ -1363,7 +1396,7 @@
1363 1396 int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse)
1364 1397 {
1365 1398 int ret = 0;
1366   -
  1399 +
1367 1400 if (tuple->TupleDataLen > tuple->TupleDataMax)
1368 1401 return -EINVAL;
1369 1402 switch (tuple->TupleCode) {
... ... @@ -1448,7 +1481,7 @@
1448 1481 /*======================================================================
1449 1482  
1450 1483 This is used internally by Card Services to look up CIS stuff.
1451   -
  1484 +
1452 1485 ======================================================================*/
1453 1486  
1454 1487 int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function, cisdata_t code, void *parse)
... ... @@ -1550,7 +1583,7 @@
1550 1583 checks include making sure several critical tuples are present and
1551 1584 valid; seeing if the total number of tuples is reasonable; and
1552 1585 looking for tuples that use reserved codes.
1553   -
  1586 +
1554 1587 ======================================================================*/
1555 1588  
1556 1589 int pccard_validate_cis(struct pcmcia_socket *s, unsigned int *info)
... ... @@ -135,7 +135,7 @@
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,7 +145,7 @@
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,7 +297,7 @@
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,7 +736,7 @@
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,7 +848,7 @@
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,7 +876,7 @@
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);
... ... @@ -57,7 +57,7 @@
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,7 +105,7 @@
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,7 +214,7 @@
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,7 +258,7 @@
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,7 +325,7 @@
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,7 +354,7 @@
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,7 +364,7 @@
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,7 +391,7 @@
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,7 +499,7 @@
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,8 +545,8 @@
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;
553 553  
... ... @@ -627,10 +627,10 @@
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,7 +756,7 @@
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,7 +852,7 @@
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,9 +865,10 @@
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  
... ... @@ -917,7 +918,7 @@
917 918 p_dev = to_pcmcia_dev(dev);
918 919  
919 920 /* calculate hashes */
920   - for (i=0; i<4; i++) {
  921 + for (i = 0; i < 4; i++) {
921 922 if (!p_dev->prod_id[i])
922 923 continue;
923 924 hash[i] = crc32(0, p_dev->prod_id[i], strlen(p_dev->prod_id[i]));
924 925  
... ... @@ -984,14 +985,14 @@
984 985 static ssize_t field##_show (struct device *dev, struct device_attribute *attr, char *buf) \
985 986 { \
986 987 struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \
987   - return p_dev->test ? sprintf (buf, format, p_dev->field) : -ENODEV; \
  988 + return p_dev->test ? sprintf(buf, format, p_dev->field) : -ENODEV; \
988 989 }
989 990  
990 991 #define pcmcia_device_stringattr(name, field) \
991 992 static ssize_t name##_show (struct device *dev, struct device_attribute *attr, char *buf) \
992 993 { \
993 994 struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \
994   - return p_dev->field ? sprintf (buf, "%s\n", p_dev->field) : -ENODEV; \
  995 + return p_dev->field ? sprintf(buf, "%s\n", p_dev->field) : -ENODEV; \
995 996 }
996 997  
997 998 pcmcia_device_attr(func, socket, "0x%02x\n");
... ... @@ -1020,8 +1021,8 @@
1020 1021 struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
1021 1022 int ret = 0;
1022 1023  
1023   - if (!count)
1024   - return -EINVAL;
  1024 + if (!count)
  1025 + return -EINVAL;
1025 1026  
1026 1027 if ((!p_dev->suspended) && !strncmp(buf, "off", 3))
1027 1028 ret = runtime_suspend(dev);
1028 1029  
... ... @@ -1039,10 +1040,11 @@
1039 1040 u32 hash[4] = { 0, 0, 0, 0};
1040 1041  
1041 1042 /* calculate hashes */
1042   - for (i=0; i<4; i++) {
  1043 + for (i = 0; i < 4; i++) {
1043 1044 if (!p_dev->prod_id[i])
1044 1045 continue;
1045   - hash[i] = crc32(0,p_dev->prod_id[i],strlen(p_dev->prod_id[i]));
  1046 + hash[i] = crc32(0, p_dev->prod_id[i],
  1047 + strlen(p_dev->prod_id[i]));
1046 1048 }
1047 1049 return sprintf(buf, "pcmcia:m%04Xc%04Xf%02Xfn%02Xpfn%02X"
1048 1050 "pa%08Xpb%08Xpc%08Xpd%08X\n",
... ... @@ -1091,7 +1093,7 @@
1091 1093  
1092 1094 /* PM support, also needed for reset */
1093 1095  
1094   -static int pcmcia_dev_suspend(struct device * dev, pm_message_t state)
  1096 +static int pcmcia_dev_suspend(struct device *dev, pm_message_t state)
1095 1097 {
1096 1098 struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
1097 1099 struct pcmcia_driver *p_drv = NULL;
1098 1100  
... ... @@ -1131,10 +1133,10 @@
1131 1133 }
1132 1134  
1133 1135  
1134   -static int pcmcia_dev_resume(struct device * dev)
  1136 +static int pcmcia_dev_resume(struct device *dev)
1135 1137 {
1136 1138 struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
1137   - struct pcmcia_driver *p_drv = NULL;
  1139 + struct pcmcia_driver *p_drv = NULL;
1138 1140 int ret = 0;
1139 1141  
1140 1142 if (!p_dev->suspended)
... ... @@ -1211,7 +1213,7 @@
1211 1213 /*======================================================================
1212 1214  
1213 1215 The card status event handler.
1214   -
  1216 +
1215 1217 ======================================================================*/
1216 1218  
1217 1219 /* Normally, the event is passed to individual drivers after
... ... @@ -1264,7 +1266,7 @@
1264 1266 } /* ds_event */
1265 1267  
1266 1268  
1267   -struct pcmcia_device * pcmcia_dev_present(struct pcmcia_device *_p_dev)
  1269 +struct pcmcia_device *pcmcia_dev_present(struct pcmcia_device *_p_dev)
1268 1270 {
1269 1271 struct pcmcia_device *p_dev;
1270 1272 struct pcmcia_device *ret = NULL;
... ... @@ -1329,7 +1331,7 @@
1329 1331 if (ret) {
1330 1332 dev_printk(KERN_ERR, dev, "PCMCIA registration failed\n");
1331 1333 pcmcia_put_socket(socket);
1332   - return (ret);
  1334 + return ret;
1333 1335 }
1334 1336  
1335 1337 return 0;
... ... @@ -1400,7 +1402,7 @@
1400 1402  
1401 1403 return 0;
1402 1404 }
1403   -fs_initcall(init_pcmcia_bus); /* one level after subsys_initcall so that
  1405 +fs_initcall(init_pcmcia_bus); /* one level after subsys_initcall so that
1404 1406 * pcmcia_socket_class is already registered */
1405 1407  
1406 1408  
drivers/pcmcia/pcmcia_ioctl.c
... ... @@ -88,12 +88,12 @@
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,7 +158,8 @@
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  
... ... @@ -195,7 +196,7 @@
195 196 begin = adj->resource.memory.Base;
196 197 end = adj->resource.memory.Base + adj->resource.memory.Size - 1;
197 198 if (s->resource_ops->add_mem)
198   - ret =s->resource_ops->add_mem(s, adj->Action, begin, end);
  199 + ret = s->resource_ops->add_mem(s, adj->Action, begin, end);
199 200 case RES_IO_RANGE:
200 201 begin = adj->resource.io.BasePort;
201 202 end = adj->resource.io.BasePort + adj->resource.io.NumPorts - 1;
... ... @@ -215,7 +216,7 @@
215 216 }
216 217 up_read(&pcmcia_socket_list_rwsem);
217 218  
218   - return (ret);
  219 + return ret;
219 220 }
220 221  
221 222  
... ... @@ -490,7 +491,7 @@
490 491 }
491 492  
492 493 spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
493   - list_for_each_entry(p_dev, &s->devices_list, socket_device_list) {
  494 + list_for_each_entry(p_dev, &s->devices_list, socket_device_list) {
494 495 if (p_dev->func == bind_info->function) {
495 496 if ((p_dev->dev.driver == &p_drv->drv)) {
496 497 if (p_dev->cardmgr) {
... ... @@ -558,7 +559,7 @@
558 559 err_put:
559 560 pcmcia_put_socket(s);
560 561  
561   - return (ret);
  562 + return ret;
562 563 } /* bind_request */
563 564  
564 565 #ifdef CONFIG_CARDBUS
... ... @@ -655,7 +656,7 @@
655 656  
656 657 err_put:
657 658 pcmcia_put_dev(p_dev);
658   - return (ret);
  659 + return ret;
659 660 } /* get_device_info */
660 661  
661 662  
... ... @@ -664,7 +665,7 @@
664 665 socket_t i = iminor(inode);
665 666 struct pcmcia_socket *s;
666 667 user_info_t *user;
667   - static int warning_printed = 0;
  668 + static int warning_printed;
668 669 int ret = 0;
669 670  
670 671 pr_debug("ds_open(socket %d)\n", i);
671 672  
672 673  
... ... @@ -738,12 +739,13 @@
738 739 s = user->socket;
739 740  
740 741 /* Unlink user data structure */
741   - if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
  742 + if ((file->f_flags & O_ACCMODE) != O_RDONLY)
742 743 s->pcmcia_state.busy = 0;
743   - }
  744 +
744 745 file->private_data = NULL;
745 746 for (link = &s->user; *link; link = &(*link)->next)
746   - if (*link == user) break;
  747 + if (*link == user)
  748 + break;
747 749 if (link == NULL)
748 750 goto out;
749 751 *link = user->next;
... ... @@ -774,7 +776,7 @@
774 776  
775 777 s = user->socket;
776 778 if (s->pcmcia_state.dead)
777   - return -EIO;
  779 + return -EIO;
778 780  
779 781 ret = wait_event_interruptible(s->queue, !queue_empty(user));
780 782 if (ret == 0)
... ... @@ -824,7 +826,7 @@
824 826  
825 827 /*====================================================================*/
826 828  
827   -static int ds_ioctl(struct inode * inode, struct file * file,
  829 +static int ds_ioctl(struct inode *inode, struct file *file,
828 830 u_int cmd, u_long arg)
829 831 {
830 832 struct pcmcia_socket *s;
831 833  
... ... @@ -842,10 +844,11 @@
842 844  
843 845 s = user->socket;
844 846 if (s->pcmcia_state.dead)
845   - return -EIO;
  847 + return -EIO;
846 848  
847 849 size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT;
848   - if (size > sizeof(ds_ioctl_arg_t)) return -EINVAL;
  850 + if (size > sizeof(ds_ioctl_arg_t))
  851 + return -EINVAL;
849 852  
850 853 /* Permission check */
851 854 if (!(cmd & IOC_OUT) && !capable(CAP_SYS_ADMIN))
... ... @@ -1024,8 +1027,8 @@
1024 1027 }
1025 1028  
1026 1029 if (cmd & IOC_OUT) {
1027   - if (__copy_to_user(uarg, (char *)buf, size))
1028   - err = -EFAULT;
  1030 + if (__copy_to_user(uarg, (char *)buf, size))
  1031 + err = -EFAULT;
1029 1032 }
1030 1033  
1031 1034 free_out:
... ... @@ -1045,7 +1048,8 @@
1045 1048 .poll = ds_poll,
1046 1049 };
1047 1050  
1048   -void __init pcmcia_setup_ioctl(void) {
  1051 +void __init pcmcia_setup_ioctl(void)
  1052 +{
1049 1053 int i;
1050 1054  
1051 1055 /* Set up character device for user mode clients */
... ... @@ -1064,7 +1068,8 @@
1064 1068 }
1065 1069  
1066 1070  
1067   -void __exit pcmcia_cleanup_ioctl(void) {
  1071 +void __exit pcmcia_cleanup_ioctl(void)
  1072 +{
1068 1073 #ifdef CONFIG_PROC_FS
1069 1074 if (proc_pccard) {
1070 1075 remove_proc_entry("drivers", proc_pccard);
drivers/pcmcia/pcmcia_resource.c
... ... @@ -33,7 +33,7 @@
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,7 +62,8 @@
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",
... ... @@ -338,7 +339,7 @@
338 339 struct pcmcia_socket *s = p_dev->socket;
339 340 config_t *c = p_dev->function_config;
340 341  
341   - if (!p_dev->_io )
  342 + if (!p_dev->_io)
342 343 return -EINVAL;
343 344  
344 345 p_dev->_io = 0;
... ... @@ -362,7 +363,7 @@
362 363 static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
363 364 {
364 365 struct pcmcia_socket *s = p_dev->socket;
365   - config_t *c= p_dev->function_config;
  366 + config_t *c = p_dev->function_config;
366 367  
367 368 if (!p_dev->_irq)
368 369 return -EINVAL;
369 370  
... ... @@ -383,9 +384,8 @@
383 384 s->irq.AssignedIRQ = 0;
384 385 }
385 386  
386   - if (req->Handler) {
  387 + if (req->Handler)
387 388 free_irq(req->AssignedIRQ, p_dev->priv);
388   - }
389 389  
390 390 #ifdef CONFIG_PCMCIA_PROBE
391 391 pcmcia_used_irq[req->AssignedIRQ]--;
... ... @@ -656,7 +656,8 @@
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  
... ... @@ -788,7 +789,8 @@
788 789  
789 790 /* Allocate system memory window */
790 791 for (w = 0; w < MAX_WIN; w++)
791   - if (!(s->state & SOCKET_WIN_REQ(w))) break;
  792 + if (!(s->state & SOCKET_WIN_REQ(w)))
  793 + break;
792 794 if (w == MAX_WIN) {
793 795 dev_dbg(&s->dev, "all windows are used already\n");
794 796 return -EINVAL;
795 797  
796 798  
797 799  
... ... @@ -826,18 +828,19 @@
826 828 s->state |= SOCKET_WIN_REQ(w);
827 829  
828 830 /* Return window handle */
829   - if (s->features & SS_CAP_STATIC_MAP) {
  831 + if (s->features & SS_CAP_STATIC_MAP)
830 832 req->Base = win->static_start;
831   - } else {
  833 + else
832 834 req->Base = win->res->start;
833   - }
  835 +
834 836 *wh = w + 1;
835 837  
836 838 return 0;
837 839 } /* pcmcia_request_window */
838 840 EXPORT_SYMBOL(pcmcia_request_window);
839 841  
840   -void pcmcia_disable_device(struct pcmcia_device *p_dev) {
  842 +void pcmcia_disable_device(struct pcmcia_device *p_dev)
  843 +{
841 844 pcmcia_release_configuration(p_dev);
842 845 pcmcia_release_io(p_dev, &p_dev->io);
843 846 pcmcia_release_irq(p_dev, &p_dev->irq);
... ... @@ -970,7 +973,7 @@
970 973  
971 974 return pccard_loop_tuple(p_dev->socket, p_dev->func, code, NULL,
972 975 &loop, pcmcia_do_loop_tuple);
973   -};
  976 +}
974 977 EXPORT_SYMBOL(pcmcia_loop_tuple);
975 978  
976 979  
... ... @@ -1000,7 +1003,7 @@
1000 1003 } else
1001 1004 dev_dbg(&p_dev->dev, "do_get_tuple: out of memory\n");
1002 1005 return 0;
1003   -};
  1006 +}
1004 1007  
1005 1008 /**
1006 1009 * pcmcia_get_tuple() - get first tuple from CIS
... ... @@ -1024,7 +1027,7 @@
1024 1027 pcmcia_loop_tuple(p_dev, code, pcmcia_do_get_tuple, &get);
1025 1028  
1026 1029 return get.len;
1027   -};
  1030 +}
1028 1031 EXPORT_SYMBOL(pcmcia_get_tuple);
1029 1032  
1030 1033  
... ... @@ -1057,7 +1060,7 @@
1057 1060 for (i = 0; i < 6; i++)
1058 1061 dev->dev_addr[i] = tuple->TupleData[i+2];
1059 1062 return 0;
1060   -};
  1063 +}
1061 1064  
1062 1065 /**
1063 1066 * pcmcia_get_mac_from_cis() - read out MAC address from CISTPL_FUNCE
... ... @@ -1071,6 +1074,6 @@
1071 1074 int pcmcia_get_mac_from_cis(struct pcmcia_device *p_dev, struct net_device *dev)
1072 1075 {
1073 1076 return pcmcia_loop_tuple(p_dev, CISTPL_FUNCE, pcmcia_do_get_mac, dev);
1074   -};
  1077 +}
1075 1078 EXPORT_SYMBOL(pcmcia_get_mac_from_cis);
drivers/pcmcia/rsrc_mgr.c
... ... @@ -126,16 +126,16 @@
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 }
drivers/pcmcia/rsrc_nonstatic.c
... ... @@ -24,9 +24,9 @@
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>
33 33  
34 34  
35 35  
... ... @@ -144,43 +144,44 @@
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 /*======================================================================
187 188  
188 189  
189 190  
190 191  
191 192  
192 193  
... ... @@ -194,69 +195,72 @@
194 195 static void do_io_probe(struct pcmcia_socket *s, unsigned int base,
195 196 unsigned int num)
196 197 {
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;
  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;
202 203  
203   - dev_printk(KERN_INFO, &s->dev, "cs: IO port probe %#x-%#x:",
204   - base, base+num-1);
  204 + dev_printk(KERN_INFO, &s->dev, "cs: IO port probe %#x-%#x:",
  205 + base, base+num-1);
205 206  
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;
213   - }
214   - for (i = base, most = 0; i < base+num; i += 8) {
215   - res = claim_region(NULL, i, 8, IORESOURCE_IO, "PCMCIA IO probe");
216   - if (!res)
217   - continue;
218   - hole = inb(i);
219   - for (j = 1; j < 8; j++)
220   - if (inb(i+j) != hole) break;
221   - free_region(res);
222   - if ((j == 8) && (++b[hole] > b[most]))
223   - most = hole;
224   - if (b[most] == 127) break;
225   - }
226   - kfree(b);
  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 ioprobe");
  217 + if (!res)
  218 + continue;
  219 + hole = inb(i);
  220 + for (j = 1; j < 8; j++)
  221 + if (inb(i+j) != hole)
  222 + break;
  223 + free_region(res);
  224 + if ((j == 8) && (++b[hole] > b[most]))
  225 + most = hole;
  226 + if (b[most] == 127)
  227 + break;
  228 + }
  229 + kfree(b);
227 230  
228   - bad = any = 0;
229   - for (i = base; i < base+num; i += 8) {
230   - res = claim_region(NULL, i, 8, IORESOURCE_IO, "PCMCIA IO probe");
231   - if (!res)
232   - continue;
233   - for (j = 0; j < 8; j++)
234   - if (inb(i+j) != most) break;
235   - free_region(res);
236   - if (j < 8) {
237   - if (!any)
238   - printk(" excluding");
239   - if (!bad)
240   - bad = any = i;
241   - } else {
242   - if (bad) {
243   - sub_interval(&s_data->io_db, bad, i-bad);
244   - printk(" %#x-%#x", bad, i-1);
245   - bad = 0;
246   - }
  231 + bad = any = 0;
  232 + for (i = base; i < base+num; i += 8) {
  233 + res = claim_region(NULL, i, 8, IORESOURCE_IO, "PCMCIA ioprobe");
  234 + if (!res)
  235 + continue;
  236 + for (j = 0; j < 8; j++)
  237 + if (inb(i+j) != most)
  238 + break;
  239 + free_region(res);
  240 + if (j < 8) {
  241 + if (!any)
  242 + printk(" excluding");
  243 + if (!bad)
  244 + bad = any = i;
  245 + } else {
  246 + if (bad) {
  247 + sub_interval(&s_data->io_db, bad, i-bad);
  248 + printk(" %#x-%#x", bad, i-1);
  249 + bad = 0;
  250 + }
  251 + }
247 252 }
248   - }
249   - if (bad) {
250   - if ((num > 16) && (bad == base) && (i == base+num)) {
251   - printk(" nothing: probe failed.\n");
252   - return;
253   - } else {
254   - sub_interval(&s_data->io_db, bad, i-bad);
255   - printk(" %#x-%#x", bad, i-1);
  253 + if (bad) {
  254 + if ((num > 16) && (bad == base) && (i == base+num)) {
  255 + printk(" nothing: probe failed.\n");
  256 + return;
  257 + } else {
  258 + sub_interval(&s_data->io_db, bad, i-bad);
  259 + printk(" %#x-%#x", bad, i-1);
  260 + }
256 261 }
257   - }
258 262  
259   - printk(any ? "\n" : " clean.\n");
  263 + printk(any ? "\n" : " clean.\n");
260 264 }
261 265 #endif
262 266  
... ... @@ -327,8 +331,9 @@
327 331 unsigned int info1, info2;
328 332 int ret = 0;
329 333  
330   - res1 = claim_region(s, base, size/2, IORESOURCE_MEM, "cs memory probe");
331   - res2 = claim_region(s, base + size/2, size/2, IORESOURCE_MEM, "cs memory probe");
  334 + res1 = claim_region(s, base, size/2, IORESOURCE_MEM, "PCMCIA memprobe");
  335 + res2 = claim_region(s, base + size/2, size/2, IORESOURCE_MEM,
  336 + "PCMCIA memprobe");
332 337  
333 338 if (res1 && res2) {
334 339 ret = readable(s, res1, &info1);
... ... @@ -347,8 +352,9 @@
347 352 struct resource *res1, *res2;
348 353 int a = -1, b = -1;
349 354  
350   - res1 = claim_region(s, base, size/2, IORESOURCE_MEM, "cs memory probe");
351   - res2 = claim_region(s, base + size/2, size/2, IORESOURCE_MEM, "cs memory probe");
  355 + res1 = claim_region(s, base, size/2, IORESOURCE_MEM, "PCMCIA memprobe");
  356 + res2 = claim_region(s, base + size/2, size/2, IORESOURCE_MEM,
  357 + "PCMCIA memprobe");
352 358  
353 359 if (res1 && res2) {
354 360 a = checksum(s, res1);
355 361  
356 362  
... ... @@ -371,42 +377,43 @@
371 377  
372 378 static int do_mem_probe(u_long base, u_long num, struct pcmcia_socket *s)
373 379 {
374   - struct socket_data *s_data = s->resource_data;
375   - u_long i, j, bad, fail, step;
  380 + struct socket_data *s_data = s->resource_data;
  381 + u_long i, j, bad, fail, step;
376 382  
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));
  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));
  400 + }
  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)
  409 + printk(" excluding");
  410 + printk(" %#05lx-%#05lx", i, j-1);
  411 + sub_interval(&s_data->mem_db, i, j-i);
  412 + bad += j-i;
  413 + }
394 414 }
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) printk(" excluding");
403   - printk(" %#05lx-%#05lx", i, j-1);
404   - sub_interval(&s_data->mem_db, i, j-i);
405   - bad += j-i;
406   - }
407   - }
408   - printk(bad ? "\n" : " clean.\n");
409   - return (num - bad);
  415 + printk(bad ? "\n" : " clean.\n");
  416 + return num - bad;
410 417 }
411 418  
412 419 #ifdef CONFIG_PCMCIA_PROBE
... ... @@ -656,7 +663,7 @@
656 663 return res;
657 664 }
658 665  
659   -static struct resource * nonstatic_find_mem_region(u_long base, u_long num,
  666 +static struct resource *nonstatic_find_mem_region(u_long base, u_long num,
660 667 u_long align, int low, struct pcmcia_socket *s)
661 668 {
662 669 struct resource *res = make_resource(0, num, IORESOURCE_MEM, dev_name(&s->dev));
... ... @@ -794,7 +801,7 @@
794 801 return -EINVAL;
795 802 #endif
796 803  
797   - for (i=0; i < PCI_BUS_NUM_RESOURCES; i++) {
  804 + for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) {
798 805 res = s->cb_dev->bus->resource[i];
799 806 if (!res)
800 807 continue;
801 808  
... ... @@ -908,14 +915,14 @@
908 915 for (p = data->io_db.next; p != &data->io_db; p = p->next) {
909 916 if (ret > (PAGE_SIZE - 10))
910 917 continue;
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));
  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));
915 922 }
916 923  
917 924 mutex_unlock(&rsrc_mutex);
918   - return (ret);
  925 + return ret;
919 926 }
920 927  
921 928 static ssize_t store_io_db(struct device *dev,
922 929  
923 930  
... ... @@ -927,12 +934,13 @@
927 934 unsigned int add = ADD_MANAGED_RESOURCE;
928 935 ssize_t ret = 0;
929 936  
930   - ret = sscanf (buf, "+ 0x%lx - 0x%lx", &start_addr, &end_addr);
  937 + ret = sscanf(buf, "+ 0x%lx - 0x%lx", &start_addr, &end_addr);
931 938 if (ret != 2) {
932   - ret = sscanf (buf, "- 0x%lx - 0x%lx", &start_addr, &end_addr);
  939 + ret = sscanf(buf, "- 0x%lx - 0x%lx", &start_addr, &end_addr);
933 940 add = REMOVE_MANAGED_RESOURCE;
934 941 if (ret != 2) {
935   - ret = sscanf (buf, "0x%lx - 0x%lx", &start_addr, &end_addr);
  942 + ret = sscanf(buf, "0x%lx - 0x%lx", &start_addr,
  943 + &end_addr);
936 944 add = ADD_MANAGED_RESOURCE;
937 945 if (ret != 2)
938 946 return -EINVAL;
939 947  
... ... @@ -963,14 +971,14 @@
963 971 for (p = data->mem_db.next; p != &data->mem_db; p = p->next) {
964 972 if (ret > (PAGE_SIZE - 10))
965 973 continue;
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));
  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));
970 978 }
971 979  
972 980 mutex_unlock(&rsrc_mutex);
973   - return (ret);
  981 + return ret;
974 982 }
975 983  
976 984 static ssize_t store_mem_db(struct device *dev,
977 985  
978 986  
... ... @@ -982,12 +990,13 @@
982 990 unsigned int add = ADD_MANAGED_RESOURCE;
983 991 ssize_t ret = 0;
984 992  
985   - ret = sscanf (buf, "+ 0x%lx - 0x%lx", &start_addr, &end_addr);
  993 + ret = sscanf(buf, "+ 0x%lx - 0x%lx", &start_addr, &end_addr);
986 994 if (ret != 2) {
987   - ret = sscanf (buf, "- 0x%lx - 0x%lx", &start_addr, &end_addr);
  995 + ret = sscanf(buf, "- 0x%lx - 0x%lx", &start_addr, &end_addr);
988 996 add = REMOVE_MANAGED_RESOURCE;
989 997 if (ret != 2) {
990   - ret = sscanf (buf, "0x%lx - 0x%lx", &start_addr, &end_addr);
  998 + ret = sscanf(buf, "0x%lx - 0x%lx", &start_addr,
  999 + &end_addr);
991 1000 add = ADD_MANAGED_RESOURCE;
992 1001 if (ret != 2)
993 1002 return -EINVAL;
drivers/pcmcia/socket_sysfs.c
... ... @@ -164,7 +164,7 @@
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,7 +278,7 @@
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,7 +308,7 @@
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,
drivers/pcmcia/yenta_socket.c
... ... @@ -6,7 +6,7 @@
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 */
13 13  
... ... @@ -16,13 +16,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  
24   -#include <asm/io.h>
25   -
26 25 #include "yenta_socket.h"
27 26 #include "i82365.h"
28 27  
... ... @@ -55,7 +54,7 @@
55 54  
56 55 static unsigned int override_bios;
57 56 module_param(override_bios, uint, 0000);
58   -MODULE_PARM_DESC (override_bios, "yenta ignore bios resource allocation");
  57 +MODULE_PARM_DESC(override_bios, "yenta ignore bios resource allocation");
59 58  
60 59 /*
61 60 * Generate easy-to-use ways of reading a cardbus sockets
62 61  
63 62  
64 63  
... ... @@ -237,24 +236,42 @@
237 236 /* i82365SL-DF style */
238 237 if (socket->flags & YENTA_16BIT_POWER_DF) {
239 238 switch (state->Vcc) {
240   - case 33: reg |= I365_VCC_3V; break;
241   - case 50: reg |= I365_VCC_5V; break;
242   - default: reg = 0; break;
  239 + case 33:
  240 + reg |= I365_VCC_3V;
  241 + break;
  242 + case 50:
  243 + reg |= I365_VCC_5V;
  244 + break;
  245 + default:
  246 + reg = 0;
  247 + break;
243 248 }
244 249 switch (state->Vpp) {
245 250 case 33:
246   - case 50: reg |= I365_VPP1_5V; break;
247   - case 120: reg |= I365_VPP1_12V; break;
  251 + case 50:
  252 + reg |= I365_VPP1_5V;
  253 + break;
  254 + case 120:
  255 + reg |= I365_VPP1_12V;
  256 + break;
248 257 }
249 258 } else {
250 259 /* i82365SL-B style */
251 260 switch (state->Vcc) {
252   - case 50: reg |= I365_VCC_5V; break;
253   - default: reg = 0; break;
  261 + case 50:
  262 + reg |= I365_VCC_5V;
  263 + break;
  264 + default:
  265 + reg = 0;
  266 + break;
254 267 }
255 268 switch (state->Vpp) {
256   - case 50: reg |= I365_VPP1_5V | I365_VPP2_5V; break;
257   - case 120: reg |= I365_VPP1_12V | I365_VPP2_12V; break;
  269 + case 50:
  270 + reg |= I365_VPP1_5V | I365_VPP2_5V;
  271 + break;
  272 + case 120:
  273 + reg |= I365_VPP1_12V | I365_VPP2_12V;
  274 + break;
258 275 }
259 276 }
260 277  
261 278  
... ... @@ -263,14 +280,26 @@
263 280 } else {
264 281 u32 reg = 0; /* CB_SC_STPCLK? */
265 282 switch (state->Vcc) {
266   - case 33: reg = CB_SC_VCC_3V; break;
267   - case 50: reg = CB_SC_VCC_5V; break;
268   - default: reg = 0; break;
  283 + case 33:
  284 + reg = CB_SC_VCC_3V;
  285 + break;
  286 + case 50:
  287 + reg = CB_SC_VCC_5V;
  288 + break;
  289 + default:
  290 + reg = 0;
  291 + break;
269 292 }
270 293 switch (state->Vpp) {
271   - case 33: reg |= CB_SC_VPP_3V; break;
272   - case 50: reg |= CB_SC_VPP_5V; break;
273   - case 120: reg |= CB_SC_VPP_12V; break;
  294 + case 33:
  295 + reg |= CB_SC_VPP_3V;
  296 + break;
  297 + case 50:
  298 + reg |= CB_SC_VPP_5V;
  299 + break;
  300 + case 120:
  301 + reg |= CB_SC_VPP_12V;
  302 + break;
274 303 }
275 304 if (reg != cb_readl(socket, CB_SOCKET_CONTROL))
276 305 cb_writel(socket, CB_SOCKET_CONTROL, reg);
277 306  
278 307  
279 308  
... ... @@ -314,23 +343,29 @@
314 343  
315 344 reg = exca_readb(socket, I365_POWER) & (I365_VCC_MASK|I365_VPP1_MASK);
316 345 reg |= I365_PWR_NORESET;
317   - if (state->flags & SS_PWR_AUTO) reg |= I365_PWR_AUTO;
318   - if (state->flags & SS_OUTPUT_ENA) reg |= I365_PWR_OUT;
  346 + if (state->flags & SS_PWR_AUTO)
  347 + reg |= I365_PWR_AUTO;
  348 + if (state->flags & SS_OUTPUT_ENA)
  349 + reg |= I365_PWR_OUT;
319 350 if (exca_readb(socket, I365_POWER) != reg)
320 351 exca_writeb(socket, I365_POWER, reg);
321 352  
322 353 /* CSC interrupt: no ISA irq for CSC */
323 354 reg = I365_CSC_DETECT;
324 355 if (state->flags & SS_IOCARD) {
325   - if (state->csc_mask & SS_STSCHG) reg |= I365_CSC_STSCHG;
  356 + if (state->csc_mask & SS_STSCHG)
  357 + reg |= I365_CSC_STSCHG;
326 358 } else {
327   - if (state->csc_mask & SS_BATDEAD) reg |= I365_CSC_BVD1;
328   - if (state->csc_mask & SS_BATWARN) reg |= I365_CSC_BVD2;
329   - if (state->csc_mask & SS_READY) reg |= I365_CSC_READY;
  359 + if (state->csc_mask & SS_BATDEAD)
  360 + reg |= I365_CSC_BVD1;
  361 + if (state->csc_mask & SS_BATWARN)
  362 + reg |= I365_CSC_BVD2;
  363 + if (state->csc_mask & SS_READY)
  364 + reg |= I365_CSC_READY;
330 365 }
331 366 exca_writeb(socket, I365_CSCINT, reg);
332 367 exca_readb(socket, I365_CSC);
333   - if(sock->zoom_video)
  368 + if (sock->zoom_video)
334 369 sock->zoom_video(sock, state->flags & SS_ZVCARD);
335 370 }
336 371 config_writew(socket, CB_BRIDGE_CONTROL, bridge);
... ... @@ -368,9 +403,12 @@
368 403 exca_writew(socket, I365_IO(map)+I365_W_STOP, io->stop);
369 404  
370 405 ioctl = exca_readb(socket, I365_IOCTL) & ~I365_IOCTL_MASK(map);
371   - if (io->flags & MAP_0WS) ioctl |= I365_IOCTL_0WS(map);
372   - if (io->flags & MAP_16BIT) ioctl |= I365_IOCTL_16BIT(map);
373   - if (io->flags & MAP_AUTOSZ) ioctl |= I365_IOCTL_IOCS16(map);
  406 + if (io->flags & MAP_0WS)
  407 + ioctl |= I365_IOCTL_0WS(map);
  408 + if (io->flags & MAP_16BIT)
  409 + ioctl |= I365_IOCTL_16BIT(map);
  410 + if (io->flags & MAP_AUTOSZ)
  411 + ioctl |= I365_IOCTL_IOCS16(map);
374 412 exca_writeb(socket, I365_IOCTL, ioctl);
375 413  
376 414 if (io->flags & MAP_ACTIVE)
... ... @@ -416,10 +454,17 @@
416 454  
417 455 word = (stop >> 12) & 0x0fff;
418 456 switch (to_cycles(mem->speed)) {
419   - case 0: break;
420   - case 1: word |= I365_MEM_WS0; break;
421   - case 2: word |= I365_MEM_WS1; break;
422   - default: word |= I365_MEM_WS1 | I365_MEM_WS0; break;
  457 + case 0:
  458 + break;
  459 + case 1:
  460 + word |= I365_MEM_WS0;
  461 + break;
  462 + case 2:
  463 + word |= I365_MEM_WS1;
  464 + break;
  465 + default:
  466 + word |= I365_MEM_WS1 | I365_MEM_WS0;
  467 + break;
423 468 }
424 469 exca_writew(socket, I365_MEM(map) + I365_W_STOP, word);
425 470  
... ... @@ -547,9 +592,9 @@
547 592 * max 4 MB, min 16 kB. We try very hard to not get below
548 593 * the "ACC" values, though.
549 594 */
550   -#define BRIDGE_MEM_MAX 4*1024*1024
551   -#define BRIDGE_MEM_ACC 128*1024
552   -#define BRIDGE_MEM_MIN 16*1024
  595 +#define BRIDGE_MEM_MAX (4*1024*1024)
  596 +#define BRIDGE_MEM_ACC (128*1024)
  597 +#define BRIDGE_MEM_MIN (16*1024)
553 598  
554 599 #define BRIDGE_IO_MAX 512
555 600 #define BRIDGE_IO_ACC 256
... ... @@ -574,7 +619,7 @@
574 619 int i;
575 620 size = BRIDGE_MEM_MAX;
576 621 if (size > avail/8) {
577   - size=(avail+1)/8;
  622 + size = (avail+1)/8;
578 623 /* round size down to next power of 2 */
579 624 i = 0;
580 625 while ((size /= 2) != 0)
... ... @@ -590,7 +635,7 @@
590 635  
591 636 do {
592 637 if (allocate_resource(root, res, size, start, end, align,
593   - NULL, NULL)==0) {
  638 + NULL, NULL) == 0) {
594 639 return 1;
595 640 }
596 641 size = size/2;
... ... @@ -605,8 +650,8 @@
605 650 u32 min)
606 651 {
607 652 int i;
608   - for (i=0; i<PCI_BUS_NUM_RESOURCES; i++) {
609   - struct resource * root = socket->dev->bus->resource[i];
  653 + for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) {
  654 + struct resource *root = socket->dev->bus->resource[i];
610 655 if (!root)
611 656 continue;
612 657  
... ... @@ -704,7 +749,7 @@
704 749 static void yenta_free_resources(struct yenta_socket *socket)
705 750 {
706 751 int i;
707   - for (i=0;i<4;i++) {
  752 + for (i = 0; i < 4; i++) {
708 753 struct resource *res;
709 754 res = socket->dev->resource + PCI_BRIDGE_RESOURCES + i;
710 755 if (res->start != 0 && res->end != 0)
... ... @@ -726,7 +771,7 @@
726 771  
727 772 /* we don't want a dying socket registered */
728 773 pcmcia_unregister_socket(&sock->socket);
729   -
  774 +
730 775 /* Disable all events so we don't die in an IRQ storm */
731 776 cb_writel(sock, CB_SOCKET_MASK, 0x0);
732 777 exca_writeb(sock, I365_CSCINT, 0);
... ... @@ -898,7 +943,7 @@
898 943 {
899 944 struct yenta_socket *socket = (struct yenta_socket *) dev_id;
900 945 u8 csc;
901   - u32 cb_event;
  946 + u32 cb_event;
902 947  
903 948 /* Clear interrupt status for the event */
904 949 cb_event = cb_readl(socket, CB_SOCKET_EVENT);
... ... @@ -1019,7 +1064,7 @@
1019 1064 {
1020 1065 struct list_head *tmp;
1021 1066 unsigned char upper_limit;
1022   - /*
  1067 + /*
1023 1068 * We only check and fix the parent bridge: All systems which need
1024 1069 * this fixup that have been reviewed are laptops and the only bridge
1025 1070 * which needed fixing was the parent bridge of the CardBus bridge:
... ... @@ -1038,7 +1083,7 @@
1038 1083  
1039 1084 /* check the bus ranges of all silbling bridges to prevent overlap */
1040 1085 list_for_each(tmp, &bridge_to_fix->parent->children) {
1041   - struct pci_bus * silbling = pci_bus_b(tmp);
  1086 + struct pci_bus *silbling = pci_bus_b(tmp);
1042 1087 /*
1043 1088 * If the silbling has a higher secondary bus number
1044 1089 * and it's secondary is equal or smaller than our
... ... @@ -1083,7 +1128,7 @@
1083 1128 * interrupt, and that we can map the cardbus area. Fill in the
1084 1129 * socket information structure..
1085 1130 */
1086   -static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_id *id)
  1131 +static int __devinit yenta_probe(struct pci_dev *dev, const struct pci_device_id *id)
1087 1132 {
1088 1133 struct yenta_socket *socket;
1089 1134 int ret;
... ... @@ -1302,7 +1347,7 @@
1302 1347 #define YENTA_PM_OPS NULL
1303 1348 #endif
1304 1349  
1305   -#define CB_ID(vend,dev,type) \
  1350 +#define CB_ID(vend, dev, type) \
1306 1351 { \
1307 1352 .vendor = vend, \
1308 1353 .device = dev, \
... ... @@ -1313,7 +1358,7 @@
1313 1358 .driver_data = CARDBUS_TYPE_##type, \
1314 1359 }
1315 1360  
1316   -static struct pci_device_id yenta_table [] = {
  1361 +static struct pci_device_id yenta_table[] = {
1317 1362 CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1031, TI),
1318 1363  
1319 1364 /*
1320 1365  
1321 1366  
... ... @@ -1403,13 +1448,13 @@
1403 1448  
1404 1449 static int __init yenta_socket_init(void)
1405 1450 {
1406   - return pci_register_driver (&yenta_cardbus_driver);
  1451 + return pci_register_driver(&yenta_cardbus_driver);
1407 1452 }
1408 1453  
1409 1454  
1410   -static void __exit yenta_socket_exit (void)
  1455 +static void __exit yenta_socket_exit(void)
1411 1456 {
1412   - pci_unregister_driver (&yenta_cardbus_driver);
  1457 + pci_unregister_driver(&yenta_cardbus_driver);
1413 1458 }
1414 1459  
1415 1460  
... ... @@ -126,8 +126,8 @@
126 126 #define IRQ_TYPE_TIME 0x01
127 127 #define IRQ_TYPE_DYNAMIC_SHARING 0x02
128 128 #define IRQ_FORCED_PULSE 0x04
129   -#define IRQ_FIRST_SHARED 0x08
130   -//#define IRQ_HANDLE_PRESENT 0x10
  129 +#define IRQ_FIRST_SHARED 0x08 /* unused */
  130 +#define IRQ_HANDLE_PRESENT 0x10 /* unused */
131 131 #define IRQ_PULSE_ALLOCATED 0x100
132 132  
133 133 /* Bits in IRQInfo1 field */
... ... @@ -82,7 +82,7 @@
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  
89 89  
... ... @@ -121,14 +121,14 @@
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 */
include/pcmcia/mem_op.h
... ... @@ -15,8 +15,8 @@
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
... ... @@ -154,7 +154,7 @@
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,7 +164,7 @@
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,9 +179,9 @@
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,7 +245,7 @@
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  
sound/pcmcia/pdaudiocf/pdaudiocf.c
... ... @@ -143,7 +143,8 @@
143 143 link->io.NumPorts1 = 16;
144 144  
145 145 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_FORCED_PULSE;
146   - // link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
  146 + /* FIXME: This driver should be updated to allow for dynamic IRQ sharing */
  147 + /* link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_FORCED_PULSE; */
147 148  
148 149 link->irq.Handler = pdacf_interrupt;
149 150 link->conf.Attributes = CONF_ENABLE_IRQ;