fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / parport / share.c
index ea62bed..fd9129e 100644 (file)
@@ -17,7 +17,6 @@
 
 #undef PARPORT_DEBUG_SHARING           /* undef for production */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/threads.h>
@@ -32,6 +31,7 @@
 #include <linux/kmod.h>
 
 #include <linux/spinlock.h>
+#include <linux/mutex.h>
 #include <asm/irq.h>
 
 #undef PARPORT_PARANOID
@@ -50,7 +50,7 @@ static DEFINE_SPINLOCK(full_list_lock);
 
 static LIST_HEAD(drivers);
 
-static DECLARE_MUTEX(registration_lock);
+static DEFINE_MUTEX(registration_lock);
 
 /* What you can do to a port that's gone away.. */
 static void dead_write_lines (struct parport *p, unsigned char b){}
@@ -158,11 +158,11 @@ int parport_register_driver (struct parport_driver *drv)
        if (list_empty(&portlist))
                get_lowlevel_driver ();
 
-       down(&registration_lock);
+       mutex_lock(&registration_lock);
        list_for_each_entry(port, &portlist, list)
                drv->attach(port);
        list_add(&drv->list, &drivers);
-       up(&registration_lock);
+       mutex_unlock(&registration_lock);
 
        return 0;
 }
@@ -188,11 +188,11 @@ void parport_unregister_driver (struct parport_driver *drv)
 {
        struct parport *port;
 
-       down(&registration_lock);
+       mutex_lock(&registration_lock);
        list_del_init(&drv->list);
        list_for_each_entry(port, &portlist, list)
                drv->detach(port);
-       up(&registration_lock);
+       mutex_unlock(&registration_lock);
 }
 
 static void free_port (struct parport *port)
@@ -217,7 +217,7 @@ static void free_port (struct parport *port)
  *     parport_get_port - increment a port's reference count
  *     @port: the port
  *
- *     This ensure's that a struct parport pointer remains valid
+ *     This ensures that a struct parport pointer remains valid
  *     until the matching parport_put_port() call.
  **/
 
@@ -366,7 +366,7 @@ void parport_announce_port (struct parport *port)
 #endif
 
        parport_proc_register(port);
-       down(&registration_lock);
+       mutex_lock(&registration_lock);
        spin_lock_irq(&parportlist_lock);
        list_add_tail(&port->list, &portlist);
        for (i = 1; i < 3; i++) {
@@ -383,7 +383,7 @@ void parport_announce_port (struct parport *port)
                if (slave)
                        attach_driver_chain(slave);
        }
-       up(&registration_lock);
+       mutex_unlock(&registration_lock);
 }
 
 /**
@@ -409,7 +409,7 @@ void parport_remove_port(struct parport *port)
 {
        int i;
 
-       down(&registration_lock);
+       mutex_lock(&registration_lock);
 
        /* Spread the word. */
        detach_driver_chain (port);
@@ -436,7 +436,7 @@ void parport_remove_port(struct parport *port)
        }
        spin_unlock(&parportlist_lock);
 
-       up(&registration_lock);
+       mutex_unlock(&registration_lock);
 
        parport_proc_unregister(port);
 
@@ -519,7 +519,7 @@ void parport_remove_port(struct parport *port)
 struct pardevice *
 parport_register_device(struct parport *port, const char *name,
                        int (*pf)(void *), void (*kf)(void *),
-                       void (*irq_func)(int, void *, struct pt_regs *), 
+                       void (*irq_func)(int, void *), 
                        int flags, void *handle)
 {
        struct pardevice *tmp;