[PATCH] sem2mutex: drivers/char/
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: Russell King <rmk@arm.linux.org.uk> Cc: Wim Van Sebroeck <wim@iguana.be> 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
b1c82b5c55
commit
6f87f0deeb
@@ -181,7 +181,6 @@ static struct tty_driver *stli_serial;
|
|||||||
* is already swapping a shared buffer won't make things any worse.
|
* is already swapping a shared buffer won't make things any worse.
|
||||||
*/
|
*/
|
||||||
static char *stli_tmpwritebuf;
|
static char *stli_tmpwritebuf;
|
||||||
static DECLARE_MUTEX(stli_tmpwritesem);
|
|
||||||
|
|
||||||
#define STLI_TXBUFSIZE 4096
|
#define STLI_TXBUFSIZE 4096
|
||||||
|
|
||||||
|
@@ -27,6 +27,7 @@
|
|||||||
#include <linux/rwsem.h>
|
#include <linux/rwsem.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/smp_lock.h>
|
#include <linux/smp_lock.h>
|
||||||
|
#include <linux/mutex.h>
|
||||||
|
|
||||||
#include <asm/hardware/dec21285.h>
|
#include <asm/hardware/dec21285.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
@@ -56,7 +57,7 @@ static int gbWriteEnable;
|
|||||||
static int gbWriteBase64Enable;
|
static int gbWriteBase64Enable;
|
||||||
static volatile unsigned char *FLASH_BASE;
|
static volatile unsigned char *FLASH_BASE;
|
||||||
static int gbFlashSize = KFLASH_SIZE;
|
static int gbFlashSize = KFLASH_SIZE;
|
||||||
static DECLARE_MUTEX(nwflash_sem);
|
static DEFINE_MUTEX(nwflash_mutex);
|
||||||
|
|
||||||
extern spinlock_t gpio_lock;
|
extern spinlock_t gpio_lock;
|
||||||
|
|
||||||
@@ -140,7 +141,7 @@ static ssize_t flash_read(struct file *file, char __user *buf, size_t size,
|
|||||||
/*
|
/*
|
||||||
* We now lock against reads and writes. --rmk
|
* We now lock against reads and writes. --rmk
|
||||||
*/
|
*/
|
||||||
if (down_interruptible(&nwflash_sem))
|
if (mutex_lock_interruptible(&nwflash_mutex))
|
||||||
return -ERESTARTSYS;
|
return -ERESTARTSYS;
|
||||||
|
|
||||||
ret = copy_to_user(buf, (void *)(FLASH_BASE + p), count);
|
ret = copy_to_user(buf, (void *)(FLASH_BASE + p), count);
|
||||||
@@ -149,7 +150,7 @@ static ssize_t flash_read(struct file *file, char __user *buf, size_t size,
|
|||||||
*ppos += count;
|
*ppos += count;
|
||||||
} else
|
} else
|
||||||
ret = -EFAULT;
|
ret = -EFAULT;
|
||||||
up(&nwflash_sem);
|
mutex_unlock(&nwflash_mutex);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -188,7 +189,7 @@ static ssize_t flash_write(struct file *file, const char __user *buf,
|
|||||||
/*
|
/*
|
||||||
* We now lock against reads and writes. --rmk
|
* We now lock against reads and writes. --rmk
|
||||||
*/
|
*/
|
||||||
if (down_interruptible(&nwflash_sem))
|
if (mutex_lock_interruptible(&nwflash_mutex))
|
||||||
return -ERESTARTSYS;
|
return -ERESTARTSYS;
|
||||||
|
|
||||||
written = 0;
|
written = 0;
|
||||||
@@ -277,7 +278,7 @@ static ssize_t flash_write(struct file *file, const char __user *buf,
|
|||||||
*/
|
*/
|
||||||
leds_event(led_release);
|
leds_event(led_release);
|
||||||
|
|
||||||
up(&nwflash_sem);
|
mutex_unlock(&nwflash_mutex);
|
||||||
|
|
||||||
return written;
|
return written;
|
||||||
}
|
}
|
||||||
|
@@ -148,7 +148,6 @@ static struct tty_driver *stl_serial;
|
|||||||
* is already swapping a shared buffer won't make things any worse.
|
* is already swapping a shared buffer won't make things any worse.
|
||||||
*/
|
*/
|
||||||
static char *stl_tmpwritebuf;
|
static char *stl_tmpwritebuf;
|
||||||
static DECLARE_MUTEX(stl_tmpwritesem);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define a local default termios struct. All ports will be created
|
* Define a local default termios struct. All ports will be created
|
||||||
|
@@ -42,6 +42,7 @@
|
|||||||
#include <linux/completion.h>
|
#include <linux/completion.h>
|
||||||
#include <asm/uaccess.h>
|
#include <asm/uaccess.h>
|
||||||
#include <linux/usb.h>
|
#include <linux/usb.h>
|
||||||
|
#include <linux/mutex.h>
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_USB_DEBUG
|
#ifdef CONFIG_USB_DEBUG
|
||||||
@@ -143,7 +144,7 @@ struct usb_pcwd_private {
|
|||||||
static struct usb_pcwd_private *usb_pcwd_device;
|
static struct usb_pcwd_private *usb_pcwd_device;
|
||||||
|
|
||||||
/* prevent races between open() and disconnect() */
|
/* prevent races between open() and disconnect() */
|
||||||
static DECLARE_MUTEX (disconnect_sem);
|
static DEFINE_MUTEX(disconnect_mutex);
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
static int usb_pcwd_probe (struct usb_interface *interface, const struct usb_device_id *id);
|
static int usb_pcwd_probe (struct usb_interface *interface, const struct usb_device_id *id);
|
||||||
@@ -723,7 +724,7 @@ static void usb_pcwd_disconnect(struct usb_interface *interface)
|
|||||||
struct usb_pcwd_private *usb_pcwd;
|
struct usb_pcwd_private *usb_pcwd;
|
||||||
|
|
||||||
/* prevent races with open() */
|
/* prevent races with open() */
|
||||||
down (&disconnect_sem);
|
mutex_lock(&disconnect_mutex);
|
||||||
|
|
||||||
usb_pcwd = usb_get_intfdata (interface);
|
usb_pcwd = usb_get_intfdata (interface);
|
||||||
usb_set_intfdata (interface, NULL);
|
usb_set_intfdata (interface, NULL);
|
||||||
@@ -749,7 +750,7 @@ static void usb_pcwd_disconnect(struct usb_interface *interface)
|
|||||||
|
|
||||||
cards_found--;
|
cards_found--;
|
||||||
|
|
||||||
up (&disconnect_sem);
|
mutex_unlock(&disconnect_mutex);
|
||||||
|
|
||||||
printk(KERN_INFO PFX "USB PC Watchdog disconnected\n");
|
printk(KERN_INFO PFX "USB PC Watchdog disconnected\n");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user