diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-10-23 06:56:46 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-11-08 12:23:13 -0500 |
commit | c9f50dddd184a020d64dab63fa795967f0f14aa4 (patch) | |
tree | b8de3c6e2860141e12fec7ba52bd25ef329590ae /drivers/pcmcia/i82365.c | |
parent | d50dbec3ce52e1608636b8a624d087da9ced8cde (diff) |
pcmcia: use dynamic debug in PCMCIA socket drivers
Make use of the dynamic debug infrastructure in various PCMCIA socket
drivers. By doing so, only the drivers relying on soc_common make use
of CONFIG_PCMCIA_DEBUG. Therefore, update the Kconfig entry accordingly.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/i82365.c')
-rw-r--r-- | drivers/pcmcia/i82365.c | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c index a4aacb830b80..c13fd9360511 100644 --- a/drivers/pcmcia/i82365.c +++ b/drivers/pcmcia/i82365.c | |||
@@ -63,21 +63,6 @@ | |||
63 | #include "vg468.h" | 63 | #include "vg468.h" |
64 | #include "ricoh.h" | 64 | #include "ricoh.h" |
65 | 65 | ||
66 | #ifdef CONFIG_PCMCIA_DEBUG | ||
67 | static const char version[] = | ||
68 | "i82365.c 1.265 1999/11/10 18:36:21 (David Hinds)"; | ||
69 | |||
70 | static int pc_debug; | ||
71 | |||
72 | module_param(pc_debug, int, 0644); | ||
73 | |||
74 | #define debug(lvl, fmt, arg...) do { \ | ||
75 | if (pc_debug > (lvl)) \ | ||
76 | printk(KERN_DEBUG "i82365: " fmt , ## arg); \ | ||
77 | } while (0) | ||
78 | #else | ||
79 | #define debug(lvl, fmt, arg...) do { } while (0) | ||
80 | #endif | ||
81 | 66 | ||
82 | static irqreturn_t i365_count_irq(int, void *); | 67 | static irqreturn_t i365_count_irq(int, void *); |
83 | static inline int _check_irq(int irq, int flags) | 68 | static inline int _check_irq(int irq, int flags) |
@@ -501,13 +486,13 @@ static irqreturn_t i365_count_irq(int irq, void *dev) | |||
501 | { | 486 | { |
502 | i365_get(irq_sock, I365_CSC); | 487 | i365_get(irq_sock, I365_CSC); |
503 | irq_hits++; | 488 | irq_hits++; |
504 | debug(2, "-> hit on irq %d\n", irq); | 489 | pr_debug("i82365: -> hit on irq %d\n", irq); |
505 | return IRQ_HANDLED; | 490 | return IRQ_HANDLED; |
506 | } | 491 | } |
507 | 492 | ||
508 | static u_int __init test_irq(u_short sock, int irq) | 493 | static u_int __init test_irq(u_short sock, int irq) |
509 | { | 494 | { |
510 | debug(2, " testing ISA irq %d\n", irq); | 495 | pr_debug("i82365: testing ISA irq %d\n", irq); |
511 | if (request_irq(irq, i365_count_irq, IRQF_PROBE_SHARED, "scan", | 496 | if (request_irq(irq, i365_count_irq, IRQF_PROBE_SHARED, "scan", |
512 | i365_count_irq) != 0) | 497 | i365_count_irq) != 0) |
513 | return 1; | 498 | return 1; |
@@ -515,7 +500,7 @@ static u_int __init test_irq(u_short sock, int irq) | |||
515 | msleep(10); | 500 | msleep(10); |
516 | if (irq_hits) { | 501 | if (irq_hits) { |
517 | free_irq(irq, i365_count_irq); | 502 | free_irq(irq, i365_count_irq); |
518 | debug(2, " spurious hit!\n"); | 503 | pr_debug("i82365: spurious hit!\n"); |
519 | return 1; | 504 | return 1; |
520 | } | 505 | } |
521 | 506 | ||
@@ -528,7 +513,7 @@ static u_int __init test_irq(u_short sock, int irq) | |||
528 | 513 | ||
529 | /* mask all interrupts */ | 514 | /* mask all interrupts */ |
530 | i365_set(sock, I365_CSCINT, 0); | 515 | i365_set(sock, I365_CSCINT, 0); |
531 | debug(2, " hits = %d\n", irq_hits); | 516 | pr_debug("i82365: hits = %d\n", irq_hits); |
532 | 517 | ||
533 | return (irq_hits != 1); | 518 | return (irq_hits != 1); |
534 | } | 519 | } |
@@ -854,7 +839,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev) | |||
854 | u_long flags = 0; | 839 | u_long flags = 0; |
855 | int handled = 0; | 840 | int handled = 0; |
856 | 841 | ||
857 | debug(4, "pcic_interrupt(%d)\n", irq); | 842 | pr_debug("pcic_interrupt(%d)\n", irq); |
858 | 843 | ||
859 | for (j = 0; j < 20; j++) { | 844 | for (j = 0; j < 20; j++) { |
860 | active = 0; | 845 | active = 0; |
@@ -878,7 +863,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev) | |||
878 | events |= (csc & I365_CSC_READY) ? SS_READY : 0; | 863 | events |= (csc & I365_CSC_READY) ? SS_READY : 0; |
879 | } | 864 | } |
880 | ISA_UNLOCK(i, flags); | 865 | ISA_UNLOCK(i, flags); |
881 | debug(2, "socket %d event 0x%02x\n", i, events); | 866 | pr_debug("socket %d event 0x%02x\n", i, events); |
882 | 867 | ||
883 | if (events) | 868 | if (events) |
884 | pcmcia_parse_events(&socket[i].socket, events); | 869 | pcmcia_parse_events(&socket[i].socket, events); |
@@ -890,7 +875,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev) | |||
890 | if (j == 20) | 875 | if (j == 20) |
891 | printk(KERN_NOTICE "i82365: infinite loop in interrupt handler\n"); | 876 | printk(KERN_NOTICE "i82365: infinite loop in interrupt handler\n"); |
892 | 877 | ||
893 | debug(4, "interrupt done\n"); | 878 | pr_debug("pcic_interrupt done\n"); |
894 | return IRQ_RETVAL(handled); | 879 | return IRQ_RETVAL(handled); |
895 | } /* pcic_interrupt */ | 880 | } /* pcic_interrupt */ |
896 | 881 | ||
@@ -932,7 +917,7 @@ static int i365_get_status(u_short sock, u_int *value) | |||
932 | } | 917 | } |
933 | } | 918 | } |
934 | 919 | ||
935 | debug(1, "GetStatus(%d) = %#4.4x\n", sock, *value); | 920 | pr_debug("GetStatus(%d) = %#4.4x\n", sock, *value); |
936 | return 0; | 921 | return 0; |
937 | } /* i365_get_status */ | 922 | } /* i365_get_status */ |
938 | 923 | ||
@@ -943,7 +928,7 @@ static int i365_set_socket(u_short sock, socket_state_t *state) | |||
943 | struct i82365_socket *t = &socket[sock]; | 928 | struct i82365_socket *t = &socket[sock]; |
944 | u_char reg; | 929 | u_char reg; |
945 | 930 | ||
946 | debug(1, "SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, " | 931 | pr_debug("SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, " |
947 | "io_irq %d, csc_mask %#2.2x)\n", sock, state->flags, | 932 | "io_irq %d, csc_mask %#2.2x)\n", sock, state->flags, |
948 | state->Vcc, state->Vpp, state->io_irq, state->csc_mask); | 933 | state->Vcc, state->Vpp, state->io_irq, state->csc_mask); |
949 | 934 | ||
@@ -1052,7 +1037,7 @@ static int i365_set_io_map(u_short sock, struct pccard_io_map *io) | |||
1052 | { | 1037 | { |
1053 | u_char map, ioctl; | 1038 | u_char map, ioctl; |
1054 | 1039 | ||
1055 | debug(1, "SetIOMap(%d, %d, %#2.2x, %d ns, " | 1040 | pr_debug("SetIOMap(%d, %d, %#2.2x, %d ns, " |
1056 | "%#llx-%#llx)\n", sock, io->map, io->flags, io->speed, | 1041 | "%#llx-%#llx)\n", sock, io->map, io->flags, io->speed, |
1057 | (unsigned long long)io->start, (unsigned long long)io->stop); | 1042 | (unsigned long long)io->start, (unsigned long long)io->stop); |
1058 | map = io->map; | 1043 | map = io->map; |
@@ -1082,7 +1067,7 @@ static int i365_set_mem_map(u_short sock, struct pccard_mem_map *mem) | |||
1082 | u_short base, i; | 1067 | u_short base, i; |
1083 | u_char map; | 1068 | u_char map; |
1084 | 1069 | ||
1085 | debug(1, "SetMemMap(%d, %d, %#2.2x, %d ns, %#llx-%#llx, " | 1070 | pr_debug("SetMemMap(%d, %d, %#2.2x, %d ns, %#llx-%#llx, " |
1086 | "%#x)\n", sock, mem->map, mem->flags, mem->speed, | 1071 | "%#x)\n", sock, mem->map, mem->flags, mem->speed, |
1087 | (unsigned long long)mem->res->start, | 1072 | (unsigned long long)mem->res->start, |
1088 | (unsigned long long)mem->res->end, mem->card_start); | 1073 | (unsigned long long)mem->res->end, mem->card_start); |