aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/m8xx_pcmcia.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2009-10-23 06:56:46 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2009-11-08 12:23:13 -0500
commitc9f50dddd184a020d64dab63fa795967f0f14aa4 (patch)
treeb8de3c6e2860141e12fec7ba52bd25ef329590ae /drivers/pcmcia/m8xx_pcmcia.c
parentd50dbec3ce52e1608636b8a624d087da9ced8cde (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/m8xx_pcmcia.c')
-rw-r--r--drivers/pcmcia/m8xx_pcmcia.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c
index 403559ba49dd..7f79c4e169ae 100644
--- a/drivers/pcmcia/m8xx_pcmcia.c
+++ b/drivers/pcmcia/m8xx_pcmcia.c
@@ -64,14 +64,6 @@
64#include <pcmcia/cs.h> 64#include <pcmcia/cs.h>
65#include <pcmcia/ss.h> 65#include <pcmcia/ss.h>
66 66
67#ifdef CONFIG_PCMCIA_DEBUG
68static int pc_debug;
69module_param(pc_debug, int, 0);
70#define dprintk(args...) printk(KERN_DEBUG "m8xx_pcmcia: " args);
71#else
72#define dprintk(args...)
73#endif
74
75#define pcmcia_info(args...) printk(KERN_INFO "m8xx_pcmcia: "args) 67#define pcmcia_info(args...) printk(KERN_INFO "m8xx_pcmcia: "args)
76#define pcmcia_error(args...) printk(KERN_ERR "m8xx_pcmcia: "args) 68#define pcmcia_error(args...) printk(KERN_ERR "m8xx_pcmcia: "args)
77 69
@@ -565,7 +557,7 @@ static irqreturn_t m8xx_interrupt(int irq, void *dev)
565 unsigned int i, events, pscr, pipr, per; 557 unsigned int i, events, pscr, pipr, per;
566 pcmconf8xx_t *pcmcia = socket[0].pcmcia; 558 pcmconf8xx_t *pcmcia = socket[0].pcmcia;
567 559
568 dprintk("Interrupt!\n"); 560 pr_debug("m8xx_pcmcia: Interrupt!\n");
569 /* get interrupt sources */ 561 /* get interrupt sources */
570 562
571 pscr = in_be32(&pcmcia->pcmc_pscr); 563 pscr = in_be32(&pcmcia->pcmc_pscr);
@@ -614,7 +606,7 @@ static irqreturn_t m8xx_interrupt(int irq, void *dev)
614 606
615 /* call the handler */ 607 /* call the handler */
616 608
617 dprintk("slot %u: events = 0x%02x, pscr = 0x%08x, " 609 pr_debug("m8xx_pcmcia: slot %u: events = 0x%02x, pscr = 0x%08x, "
618 "pipr = 0x%08x\n", i, events, pscr, pipr); 610 "pipr = 0x%08x\n", i, events, pscr, pipr);
619 611
620 if (events) { 612 if (events) {
@@ -641,7 +633,7 @@ static irqreturn_t m8xx_interrupt(int irq, void *dev)
641 /* clear the interrupt sources */ 633 /* clear the interrupt sources */
642 out_be32(&pcmcia->pcmc_pscr, pscr); 634 out_be32(&pcmcia->pcmc_pscr, pscr);
643 635
644 dprintk("Interrupt done.\n"); 636 pr_debug("m8xx_pcmcia: Interrupt done.\n");
645 637
646 return IRQ_HANDLED; 638 return IRQ_HANDLED;
647} 639}
@@ -815,7 +807,7 @@ static int m8xx_get_status(struct pcmcia_socket *sock, unsigned int *value)
815 }; 807 };
816 } 808 }
817 809
818 dprintk("GetStatus(%d) = %#2.2x\n", lsock, *value); 810 pr_debug("m8xx_pcmcia: GetStatus(%d) = %#2.2x\n", lsock, *value);
819 return 0; 811 return 0;
820} 812}
821 813
@@ -828,7 +820,7 @@ static int m8xx_set_socket(struct pcmcia_socket *sock, socket_state_t * state)
828 unsigned long flags; 820 unsigned long flags;
829 pcmconf8xx_t *pcmcia = socket[0].pcmcia; 821 pcmconf8xx_t *pcmcia = socket[0].pcmcia;
830 822
831 dprintk("SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, " 823 pr_debug("m8xx_pcmcia: SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
832 "io_irq %d, csc_mask %#2.2x)\n", lsock, state->flags, 824 "io_irq %d, csc_mask %#2.2x)\n", lsock, state->flags,
833 state->Vcc, state->Vpp, state->io_irq, state->csc_mask); 825 state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
834 826
@@ -974,7 +966,7 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
974#define M8XX_SIZE (io->stop - io->start + 1) 966#define M8XX_SIZE (io->stop - io->start + 1)
975#define M8XX_BASE (PCMCIA_IO_WIN_BASE + io->start) 967#define M8XX_BASE (PCMCIA_IO_WIN_BASE + io->start)
976 968
977 dprintk("SetIOMap(%d, %d, %#2.2x, %d ns, " 969 pr_debug("m8xx_pcmcia: SetIOMap(%d, %d, %#2.2x, %d ns, "
978 "%#4.4llx-%#4.4llx)\n", lsock, io->map, io->flags, 970 "%#4.4llx-%#4.4llx)\n", lsock, io->map, io->flags,
979 io->speed, (unsigned long long)io->start, 971 io->speed, (unsigned long long)io->start,
980 (unsigned long long)io->stop); 972 (unsigned long long)io->stop);
@@ -988,7 +980,7 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
988 980
989 if (io->flags & MAP_ACTIVE) { 981 if (io->flags & MAP_ACTIVE) {
990 982
991 dprintk("io->flags & MAP_ACTIVE\n"); 983 pr_debug("m8xx_pcmcia: io->flags & MAP_ACTIVE\n");
992 984
993 winnr = (PCMCIA_MEM_WIN_NO * PCMCIA_SOCKETS_NO) 985 winnr = (PCMCIA_MEM_WIN_NO * PCMCIA_SOCKETS_NO)
994 + (lsock * PCMCIA_IO_WIN_NO) + io->map; 986 + (lsock * PCMCIA_IO_WIN_NO) + io->map;
@@ -1018,8 +1010,8 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
1018 1010
1019 out_be32(&w->or, reg); 1011 out_be32(&w->or, reg);
1020 1012
1021 dprintk("Socket %u: Mapped io window %u at %#8.8x, " 1013 pr_debug("m8xx_pcmcia: Socket %u: Mapped io window %u at "
1022 "OR = %#8.8x.\n", lsock, io->map, w->br, w->or); 1014 "%#8.8x, OR = %#8.8x.\n", lsock, io->map, w->br, w->or);
1023 } else { 1015 } else {
1024 /* shutdown IO window */ 1016 /* shutdown IO window */
1025 winnr = (PCMCIA_MEM_WIN_NO * PCMCIA_SOCKETS_NO) 1017 winnr = (PCMCIA_MEM_WIN_NO * PCMCIA_SOCKETS_NO)
@@ -1033,14 +1025,14 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
1033 out_be32(&w->or, 0); /* turn off window */ 1025 out_be32(&w->or, 0); /* turn off window */
1034 out_be32(&w->br, 0); /* turn off base address */ 1026 out_be32(&w->br, 0); /* turn off base address */
1035 1027
1036 dprintk("Socket %u: Unmapped io window %u at %#8.8x, " 1028 pr_debug("m8xx_pcmcia: Socket %u: Unmapped io window %u at "
1037 "OR = %#8.8x.\n", lsock, io->map, w->br, w->or); 1029 "%#8.8x, OR = %#8.8x.\n", lsock, io->map, w->br, w->or);
1038 } 1030 }
1039 1031
1040 /* copy the struct and modify the copy */ 1032 /* copy the struct and modify the copy */
1041 s->io_win[io->map] = *io; 1033 s->io_win[io->map] = *io;
1042 s->io_win[io->map].flags &= (MAP_WRPROT | MAP_16BIT | MAP_ACTIVE); 1034 s->io_win[io->map].flags &= (MAP_WRPROT | MAP_16BIT | MAP_ACTIVE);
1043 dprintk("SetIOMap exit\n"); 1035 pr_debug("m8xx_pcmcia: SetIOMap exit\n");
1044 1036
1045 return 0; 1037 return 0;
1046} 1038}
@@ -1055,7 +1047,7 @@ static int m8xx_set_mem_map(struct pcmcia_socket *sock,
1055 unsigned int reg, winnr; 1047 unsigned int reg, winnr;
1056 pcmconf8xx_t *pcmcia = s->pcmcia; 1048 pcmconf8xx_t *pcmcia = s->pcmcia;
1057 1049
1058 dprintk("SetMemMap(%d, %d, %#2.2x, %d ns, " 1050 pr_debug("m8xx_pcmcia: SetMemMap(%d, %d, %#2.2x, %d ns, "
1059 "%#5.5llx, %#5.5x)\n", lsock, mem->map, mem->flags, 1051 "%#5.5llx, %#5.5x)\n", lsock, mem->map, mem->flags,
1060 mem->speed, (unsigned long long)mem->static_start, 1052 mem->speed, (unsigned long long)mem->static_start,
1061 mem->card_start); 1053 mem->card_start);
@@ -1098,7 +1090,7 @@ static int m8xx_set_mem_map(struct pcmcia_socket *sock,
1098 1090
1099 out_be32(&w->or, reg); 1091 out_be32(&w->or, reg);
1100 1092
1101 dprintk("Socket %u: Mapped memory window %u at %#8.8x, " 1093 pr_debug("m8xx_pcmcia: Socket %u: Mapped memory window %u at %#8.8x, "
1102 "OR = %#8.8x.\n", lsock, mem->map, w->br, w->or); 1094 "OR = %#8.8x.\n", lsock, mem->map, w->br, w->or);
1103 1095
1104 if (mem->flags & MAP_ACTIVE) { 1096 if (mem->flags & MAP_ACTIVE) {
@@ -1108,7 +1100,7 @@ static int m8xx_set_mem_map(struct pcmcia_socket *sock,
1108 + mem->card_start; 1100 + mem->card_start;
1109 } 1101 }
1110 1102
1111 dprintk("SetMemMap(%d, %d, %#2.2x, %d ns, " 1103 pr_debug("m8xx_pcmcia: SetMemMap(%d, %d, %#2.2x, %d ns, "
1112 "%#5.5llx, %#5.5x)\n", lsock, mem->map, mem->flags, 1104 "%#5.5llx, %#5.5x)\n", lsock, mem->map, mem->flags,
1113 mem->speed, (unsigned long long)mem->static_start, 1105 mem->speed, (unsigned long long)mem->static_start,
1114 mem->card_start); 1106 mem->card_start);
@@ -1129,7 +1121,7 @@ static int m8xx_sock_init(struct pcmcia_socket *sock)
1129 pccard_io_map io = { 0, 0, 0, 0, 1 }; 1121 pccard_io_map io = { 0, 0, 0, 0, 1 };
1130 pccard_mem_map mem = { 0, 0, 0, 0, 0, 0 }; 1122 pccard_mem_map mem = { 0, 0, 0, 0, 0, 0 };
1131 1123
1132 dprintk("sock_init(%d)\n", s); 1124 pr_debug("m8xx_pcmcia: sock_init(%d)\n", s);
1133 1125
1134 m8xx_set_socket(sock, &dead_socket); 1126 m8xx_set_socket(sock, &dead_socket);
1135 for (i = 0; i < PCMCIA_IO_WIN_NO; i++) { 1127 for (i = 0; i < PCMCIA_IO_WIN_NO; i++) {