pcmcia: card services header cleanup
[safe/jmp/linux-2.6] / drivers / pcmcia / m32r_pcc.c
index 3397ff2..2f108c2 100644 (file)
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/fcntl.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/timer.h>
-#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
 #include <linux/workqueue.h>
 #include <linux/interrupt.h>
-#include <linux/device.h>
+#include <linux/platform_device.h>
+#include <linux/bitops.h>
 #include <asm/irq.h>
 #include <asm/io.h>
-#include <asm/bitops.h>
 #include <asm/system.h>
 #include <asm/addrspace.h>
 
@@ -47,7 +45,7 @@
 
 #define PCC_DEBUG_DBEX
 
-#ifdef DEBUG
+#ifdef CONFIG_PCMCIA_DEBUG
 static int m32r_pcc_debug;
 module_param(m32r_pcc_debug, int, 0644);
 #define debug(lvl, fmt, arg...) do {                           \
@@ -67,7 +65,7 @@ typedef struct pcc_socket {
        u_short                 type, flags;
        struct pcmcia_socket    socket;
        unsigned int            number;
-       kio_addr_t              ioaddr;
+       unsigned int            ioaddr;
        u_long                  mapaddr;
        u_long                  base;   /* PCC register base */
        u_char                  cs_irq, intr;
@@ -268,7 +266,7 @@ static pcc_t pcc[] = {
        { "xnux2", 0 }, { "xnux2", 0 },
 };
 
-static irqreturn_t pcc_interrupt(int, void *, struct pt_regs *);
+static irqreturn_t pcc_interrupt(int, void *);
 
 /*====================================================================*/
 
@@ -312,7 +310,8 @@ static int __init is_alive(u_short sock)
        return 0;
 }
 
-static void add_pcc_socket(ulong base, int irq, ulong mapaddr, kio_addr_t ioaddr)
+static void add_pcc_socket(ulong base, int irq, ulong mapaddr,
+                          unsigned int ioaddr)
 {
        pcc_socket_t *t = &socket[pcc_sockets];
 
@@ -353,7 +352,7 @@ static void add_pcc_socket(ulong base, int irq, ulong mapaddr, kio_addr_t ioaddr
 
 /*====================================================================*/
 
-static irqreturn_t pcc_interrupt(int irq, void *dev, struct pt_regs *regs)
+static irqreturn_t pcc_interrupt(int irq, void *dev)
 {
        int i, j, irc;
        u_int events, active;
@@ -370,7 +369,7 @@ static irqreturn_t pcc_interrupt(int irq, void *dev, struct pt_regs *regs)
                        handled = 1;
                        irc = pcc_get(i, PCIRC);
                        irc >>=16;
-                       debug(2, "m32r-pcc:interrput: socket %d pcirc 0x%02x ", i, irc);
+                       debug(2, "m32r-pcc:interrupt: socket %d pcirc 0x%02x ", i, irc);
                        if (!irc)
                                continue;
 
@@ -396,7 +395,7 @@ static irqreturn_t pcc_interrupt(int irq, void *dev, struct pt_regs *regs)
 
 static void pcc_interrupt_wrapper(u_long data)
 {
-       pcc_interrupt(0, NULL, NULL);
+       pcc_interrupt(0, NULL);
        init_timer(&poll_timer);
        poll_timer.expires = jiffies + poll_interval;
        add_timer(&poll_timer);
@@ -429,16 +428,6 @@ static int _pcc_get_status(u_short sock, u_int *value)
 
 /*====================================================================*/
 
-static int _pcc_get_socket(u_short sock, socket_state_t *state)
-{
-       debug(3, "m32r-pcc: GetSocket(%d) = flags %#3.3x, Vcc %d, Vpp %d, "
-                 "io_irq %d, csc_mask %#2.2x\n", sock, state->flags,
-                 state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
-       return 0;
-} /* _get_socket */
-
-/*====================================================================*/
-
 static int _pcc_set_socket(u_short sock, socket_state_t *state)
 {
        u_long reg = 0;
@@ -471,7 +460,7 @@ static int _pcc_set_socket(u_short sock, socket_state_t *state)
 
        pcc_set(sock,PCCSIGCR,reg);
 
-#ifdef DEBUG
+#ifdef CONFIG_PCMCIA_DEBUG
        if(state->flags & SS_IOCARD){
                debug(3, ":IOCARD");
        }
@@ -503,7 +492,7 @@ static int _pcc_set_io_map(u_short sock, struct pccard_io_map *io)
        u_char map;
 
        debug(3, "m32r-pcc: SetIOMap(%d, %d, %#2.2x, %d ns, "
-                 "%#lx-%#lx)\n", sock, io->map, io->flags,
+                 "%#x-%#x)\n", sock, io->map, io->flags,
                  io->speed, io->start, io->stop);
        map = io->map;
 
@@ -641,15 +630,6 @@ static int pcc_get_status(struct pcmcia_socket *s, u_int *value)
        LOCKED(_pcc_get_status(sock, value));
 }
 
-static int pcc_get_socket(struct pcmcia_socket *s, socket_state_t *state)
-{
-       unsigned int sock = container_of(s, struct pcc_socket, socket)->number;
-
-       if (socket[sock].flags & IS_ALIVE)
-               return -EINVAL;
-       LOCKED(_pcc_get_socket(sock, state));
-}
-
 static int pcc_set_socket(struct pcmcia_socket *s, socket_state_t *state)
 {
        unsigned int sock = container_of(s, struct pcc_socket, socket)->number;
@@ -687,7 +667,6 @@ static int pcc_init(struct pcmcia_socket *s)
 static struct pccard_operations pcc_operations = {
        .init                   = pcc_init,
        .get_status             = pcc_get_status,
-       .get_socket             = pcc_get_socket,
        .set_socket             = pcc_set_socket,
        .set_io_map             = pcc_set_io_map,
        .set_mem_map            = pcc_set_mem_map,
@@ -743,7 +722,7 @@ static int __init init_m32r_pcc(void)
        /* Set up interrupt handler(s) */
 
        for (i = 0 ; i < pcc_sockets ; i++) {
-               socket[i].socket.dev.dev = &pcc_device.dev;
+               socket[i].socket.dev.parent = &pcc_device.dev;
                socket[i].socket.ops = &pcc_operations;
                socket[i].socket.resource_ops = &pccard_static_ops;
                socket[i].socket.owner = THIS_MODULE;