Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
#include <linux/interrupt.h>
#include <linux/poll.h>
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/poll.h>
#include <linux/device.h>
+#include <linux/mutex.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
MODULE_DESCRIPTION("Input core");
MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
MODULE_DESCRIPTION("Input core");
struct input_dev *dev = handle->dev;
int err;
struct input_dev *dev = handle->dev;
int err;
- err = down_interruptible(&dev->sem);
+ err = mutex_lock_interruptible(&dev->mutex);
+ mutex_unlock(&dev->mutex);
input_release_device(handle);
input_release_device(handle);
+ mutex_lock(&dev->mutex);
if (!--dev->users && dev->close)
dev->close(dev);
handle->open--;
if (!--dev->users && dev->close)
dev->close(dev);
handle->open--;
+ mutex_unlock(&dev->mutex);
}
static void input_link_handle(struct input_handle *handle)
}
static void input_link_handle(struct input_handle *handle)
struct input_dev *input_dev = to_input_dev(dev); \
int retval; \
\
struct input_dev *input_dev = to_input_dev(dev); \
int retval; \
\
- retval = down_interruptible(&input_dev->sem); \
+ retval = mutex_lock_interruptible(&input_dev->mutex); \
if (retval) \
return retval; \
\
retval = sprintf(buf, "%s\n", input_dev->name ? input_dev->name : ""); \
\
if (retval) \
return retval; \
\
retval = sprintf(buf, "%s\n", input_dev->name ? input_dev->name : ""); \
\
+ mutex_unlock(&input_dev->mutex); \
+ mutex_init(&dev->mutex);
set_bit(EV_SYN, dev->evbit);
/*
set_bit(EV_SYN, dev->evbit);
/*
struct input_handle *grab;
struct input_handle *grab;
- struct semaphore sem; /* serializes open and close operations */
+ struct mutex mutex; /* serializes open and close operations */
unsigned int users;
struct class_device cdev;
unsigned int users;
struct class_device cdev;