V4L/DVB: v4l2-dev: remove unnecessary lock around atomic clear_bit
[safe/jmp/linux-2.6] / drivers / pcmcia / m8xx_pcmcia.c
index d1ad096..41cc954 100644 (file)
@@ -42,7 +42,6 @@
 
 #include <linux/kernel.h>
 #include <linux/errno.h>
-#include <linux/slab.h>
 #include <linux/timer.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
 #include <pcmcia/cs.h>
 #include <pcmcia/ss.h>
 
-#ifdef CONFIG_PCMCIA_DEBUG
-static int pc_debug;
-module_param(pc_debug, int, 0);
-#define dprintk(args...) printk(KERN_DEBUG "m8xx_pcmcia: " args);
-#else
-#define dprintk(args...)
-#endif
-
 #define pcmcia_info(args...) printk(KERN_INFO "m8xx_pcmcia: "args)
 #define pcmcia_error(args...) printk(KERN_ERR "m8xx_pcmcia: "args)
 
@@ -565,7 +556,7 @@ static irqreturn_t m8xx_interrupt(int irq, void *dev)
        unsigned int i, events, pscr, pipr, per;
        pcmconf8xx_t *pcmcia = socket[0].pcmcia;
 
-       dprintk("Interrupt!\n");
+       pr_debug("m8xx_pcmcia: Interrupt!\n");
        /* get interrupt sources */
 
        pscr = in_be32(&pcmcia->pcmc_pscr);
@@ -614,7 +605,7 @@ static irqreturn_t m8xx_interrupt(int irq, void *dev)
 
                /* call the handler */
 
-               dprintk("slot %u: events = 0x%02x, pscr = 0x%08x, "
+               pr_debug("m8xx_pcmcia: slot %u: events = 0x%02x, pscr = 0x%08x, "
                        "pipr = 0x%08x\n", i, events, pscr, pipr);
 
                if (events) {
@@ -641,7 +632,7 @@ static irqreturn_t m8xx_interrupt(int irq, void *dev)
        /* clear the interrupt sources */
        out_be32(&pcmcia->pcmc_pscr, pscr);
 
-       dprintk("Interrupt done.\n");
+       pr_debug("m8xx_pcmcia: Interrupt done.\n");
 
        return IRQ_HANDLED;
 }
@@ -815,7 +806,7 @@ static int m8xx_get_status(struct pcmcia_socket *sock, unsigned int *value)
                };
        }
 
-       dprintk("GetStatus(%d) = %#2.2x\n", lsock, *value);
+       pr_debug("m8xx_pcmcia: GetStatus(%d) = %#2.2x\n", lsock, *value);
        return 0;
 }
 
@@ -828,7 +819,7 @@ static int m8xx_set_socket(struct pcmcia_socket *sock, socket_state_t * state)
        unsigned long flags;
        pcmconf8xx_t *pcmcia = socket[0].pcmcia;
 
-       dprintk("SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
+       pr_debug("m8xx_pcmcia: SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
                "io_irq %d, csc_mask %#2.2x)\n", lsock, state->flags,
                state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
 
@@ -974,9 +965,10 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
 #define M8XX_SIZE (io->stop - io->start + 1)
 #define M8XX_BASE (PCMCIA_IO_WIN_BASE + io->start)
 
-       dprintk("SetIOMap(%d, %d, %#2.2x, %d ns, "
-               "%#4.4x-%#4.4x)\n", lsock, io->map, io->flags,
-               io->speed, io->start, io->stop);
+       pr_debug("m8xx_pcmcia: SetIOMap(%d, %d, %#2.2x, %d ns, "
+               "%#4.4llx-%#4.4llx)\n", lsock, io->map, io->flags,
+               io->speed, (unsigned long long)io->start,
+               (unsigned long long)io->stop);
 
        if ((io->map >= PCMCIA_IO_WIN_NO) || (io->start > 0xffff)
            || (io->stop > 0xffff) || (io->stop < io->start))
@@ -987,7 +979,7 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
 
        if (io->flags & MAP_ACTIVE) {
 
-               dprintk("io->flags & MAP_ACTIVE\n");
+               pr_debug("m8xx_pcmcia: io->flags & MAP_ACTIVE\n");
 
                winnr = (PCMCIA_MEM_WIN_NO * PCMCIA_SOCKETS_NO)
                    + (lsock * PCMCIA_IO_WIN_NO) + io->map;
@@ -1017,8 +1009,8 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
 
                out_be32(&w->or, reg);
 
-               dprintk("Socket %u: Mapped io window %u at %#8.8x, "
-                       "OR = %#8.8x.\n", lsock, io->map, w->br, w->or);
+               pr_debug("m8xx_pcmcia: Socket %u: Mapped io window %u at "
+                       "%#8.8x, OR = %#8.8x.\n", lsock, io->map, w->br, w->or);
        } else {
                /* shutdown IO window */
                winnr = (PCMCIA_MEM_WIN_NO * PCMCIA_SOCKETS_NO)
@@ -1032,14 +1024,14 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
                out_be32(&w->or, 0);    /* turn off window */
                out_be32(&w->br, 0);    /* turn off base address */
 
-               dprintk("Socket %u: Unmapped io window %u at %#8.8x, "
-                       "OR = %#8.8x.\n", lsock, io->map, w->br, w->or);
+               pr_debug("m8xx_pcmcia: Socket %u: Unmapped io window %u at "
+                       "%#8.8x, OR = %#8.8x.\n", lsock, io->map, w->br, w->or);
        }
 
        /* copy the struct and modify the copy */
        s->io_win[io->map] = *io;
        s->io_win[io->map].flags &= (MAP_WRPROT | MAP_16BIT | MAP_ACTIVE);
-       dprintk("SetIOMap exit\n");
+       pr_debug("m8xx_pcmcia: SetIOMap exit\n");
 
        return 0;
 }
@@ -1054,9 +1046,10 @@ static int m8xx_set_mem_map(struct pcmcia_socket *sock,
        unsigned int reg, winnr;
        pcmconf8xx_t *pcmcia = s->pcmcia;
 
-       dprintk("SetMemMap(%d, %d, %#2.2x, %d ns, "
-               "%#5.5lx, %#5.5x)\n", lsock, mem->map, mem->flags,
-               mem->speed, mem->static_start, mem->card_start);
+       pr_debug("m8xx_pcmcia: SetMemMap(%d, %d, %#2.2x, %d ns, "
+               "%#5.5llx, %#5.5x)\n", lsock, mem->map, mem->flags,
+               mem->speed, (unsigned long long)mem->static_start,
+               mem->card_start);
 
        if ((mem->map >= PCMCIA_MEM_WIN_NO)
 //          || ((mem->s) >= PCMCIA_MEM_WIN_SIZE)
@@ -1096,7 +1089,7 @@ static int m8xx_set_mem_map(struct pcmcia_socket *sock,
 
        out_be32(&w->or, reg);
 
-       dprintk("Socket %u: Mapped memory window %u at %#8.8x, "
+       pr_debug("m8xx_pcmcia: Socket %u: Mapped memory window %u at %#8.8x, "
                "OR = %#8.8x.\n", lsock, mem->map, w->br, w->or);
 
        if (mem->flags & MAP_ACTIVE) {
@@ -1106,9 +1099,10 @@ static int m8xx_set_mem_map(struct pcmcia_socket *sock,
                    + mem->card_start;
        }
 
-       dprintk("SetMemMap(%d, %d, %#2.2x, %d ns, "
-               "%#5.5lx, %#5.5x)\n", lsock, mem->map, mem->flags,
-               mem->speed, mem->static_start, mem->card_start);
+       pr_debug("m8xx_pcmcia: SetMemMap(%d, %d, %#2.2x, %d ns, "
+               "%#5.5llx, %#5.5x)\n", lsock, mem->map, mem->flags,
+               mem->speed, (unsigned long long)mem->static_start,
+               mem->card_start);
 
        /* copy the struct and modify the copy */
 
@@ -1126,7 +1120,7 @@ static int m8xx_sock_init(struct pcmcia_socket *sock)
        pccard_io_map io = { 0, 0, 0, 0, 1 };
        pccard_mem_map mem = { 0, 0, 0, 0, 0, 0 };
 
-       dprintk("sock_init(%d)\n", s);
+       pr_debug("m8xx_pcmcia: sock_init(%d)\n", s);
 
        m8xx_set_socket(sock, &dead_socket);
        for (i = 0; i < PCMCIA_IO_WIN_NO; i++) {
@@ -1238,7 +1232,7 @@ static int __init m8xx_probe(struct of_device *ofdev,
                socket[i].socket.io_offset = 0;
                socket[i].socket.pci_irq = pcmcia_schlvl;
                socket[i].socket.ops = &m8xx_services;
-               socket[i].socket.resource_ops = &pccard_nonstatic_ops;
+               socket[i].socket.resource_ops = &pccard_iodyn_ops;
                socket[i].socket.cb_dev = NULL;
                socket[i].socket.dev.parent = &ofdev->dev;
                socket[i].pcmcia = pcmcia;
@@ -1293,22 +1287,7 @@ static int m8xx_remove(struct of_device *ofdev)
        return 0;
 }
 
-#ifdef CONFIG_PM
-static int m8xx_suspend(struct platform_device *pdev, pm_message_t state)
-{
-       return pcmcia_socket_dev_suspend(&pdev->dev, state);
-}
-
-static int m8xx_resume(struct platform_device *pdev)
-{
-       return pcmcia_socket_dev_resume(&pdev->dev);
-}
-#else
-#define m8xx_suspend NULL
-#define m8xx_resume NULL
-#endif
-
-static struct of_device_id m8xx_pcmcia_match[] = {
+static const struct of_device_id m8xx_pcmcia_match[] = {
        {
         .type = "pcmcia",
         .compatible = "fsl,pq-pcmcia",
@@ -1323,8 +1302,6 @@ static struct of_platform_driver m8xx_pcmcia_driver = {
        .match_table = m8xx_pcmcia_match,
        .probe = m8xx_probe,
        .remove = m8xx_remove,
-       .suspend = m8xx_suspend,
-       .resume = m8xx_resume,
 };
 
 static int __init m8xx_init(void)