[PATCH] sem2mutex: misc static one-file mutexes
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Ingo Molnar <mingo@elte.hu> Cc: Dave Jones <davej@codemonkey.org.uk> Cc: Paul Mackerras <paulus@samba.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Jens Axboe <axboe@suse.de> Cc: Neil Brown <neilb@cse.unsw.edu.au> Acked-by: Alasdair G Kergon <agk@redhat.com> Cc: Greg KH <greg@kroah.com> Cc: Dominik Brodowski <linux@dominikbrodowski.net> Cc: Adam Belay <ambx1@neo.rr.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committed by
Linus Torvalds

parent
353ab6e97b
commit
14cc3e2b63
@@ -32,6 +32,7 @@
|
||||
#include <linux/kmod.h>
|
||||
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <asm/irq.h>
|
||||
|
||||
#undef PARPORT_PARANOID
|
||||
@@ -50,7 +51,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 +159,11 @@ int parport_register_driver (struct parport_driver *drv)
|
||||
if (list_empty(&portlist))
|
||||
get_lowlevel_driver ();
|
||||
|
||||
down(®istration_lock);
|
||||
mutex_lock(®istration_lock);
|
||||
list_for_each_entry(port, &portlist, list)
|
||||
drv->attach(port);
|
||||
list_add(&drv->list, &drivers);
|
||||
up(®istration_lock);
|
||||
mutex_unlock(®istration_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -188,11 +189,11 @@ void parport_unregister_driver (struct parport_driver *drv)
|
||||
{
|
||||
struct parport *port;
|
||||
|
||||
down(®istration_lock);
|
||||
mutex_lock(®istration_lock);
|
||||
list_del_init(&drv->list);
|
||||
list_for_each_entry(port, &portlist, list)
|
||||
drv->detach(port);
|
||||
up(®istration_lock);
|
||||
mutex_unlock(®istration_lock);
|
||||
}
|
||||
|
||||
static void free_port (struct parport *port)
|
||||
@@ -366,7 +367,7 @@ void parport_announce_port (struct parport *port)
|
||||
#endif
|
||||
|
||||
parport_proc_register(port);
|
||||
down(®istration_lock);
|
||||
mutex_lock(®istration_lock);
|
||||
spin_lock_irq(&parportlist_lock);
|
||||
list_add_tail(&port->list, &portlist);
|
||||
for (i = 1; i < 3; i++) {
|
||||
@@ -383,7 +384,7 @@ void parport_announce_port (struct parport *port)
|
||||
if (slave)
|
||||
attach_driver_chain(slave);
|
||||
}
|
||||
up(®istration_lock);
|
||||
mutex_unlock(®istration_lock);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -409,7 +410,7 @@ void parport_remove_port(struct parport *port)
|
||||
{
|
||||
int i;
|
||||
|
||||
down(®istration_lock);
|
||||
mutex_lock(®istration_lock);
|
||||
|
||||
/* Spread the word. */
|
||||
detach_driver_chain (port);
|
||||
@@ -436,7 +437,7 @@ void parport_remove_port(struct parport *port)
|
||||
}
|
||||
spin_unlock(&parportlist_lock);
|
||||
|
||||
up(®istration_lock);
|
||||
mutex_unlock(®istration_lock);
|
||||
|
||||
parport_proc_unregister(port);
|
||||
|
||||
|
Reference in New Issue
Block a user