aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/input.c
diff options
context:
space:
mode:
authorJes Sorensen <jes@sgi.com>2006-02-19 00:21:46 -0500
committerDmitry Torokhov <dtor_core@ameritech.net>2006-02-19 00:21:46 -0500
commite676c232e670e27d8b3783e1167f34288e17c83f (patch)
tree65b4c990273cded5bf3ab7af3504973bad7dcd2d /drivers/input/input.c
parent02860ab6cd2c71dbe42fa70a65a97823c213635b (diff)
Input: input core - semaphore to mutex conversion
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>
Diffstat (limited to 'drivers/input/input.c')
-rw-r--r--drivers/input/input.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 4fe3da3c667a..3e22bb11ee05 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -21,6 +21,7 @@
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/poll.h> 22#include <linux/poll.h>
23#include <linux/device.h> 23#include <linux/device.h>
24#include <linux/mutex.h>
24 25
25MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>"); 26MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
26MODULE_DESCRIPTION("Input core"); 27MODULE_DESCRIPTION("Input core");
@@ -224,7 +225,7 @@ int input_open_device(struct input_handle *handle)
224 struct input_dev *dev = handle->dev; 225 struct input_dev *dev = handle->dev;
225 int err; 226 int err;
226 227
227 err = down_interruptible(&dev->sem); 228 err = mutex_lock_interruptible(&dev->mutex);
228 if (err) 229 if (err)
229 return err; 230 return err;
230 231
@@ -236,7 +237,7 @@ int input_open_device(struct input_handle *handle)
236 if (err) 237 if (err)
237 handle->open--; 238 handle->open--;
238 239
239 up(&dev->sem); 240 mutex_unlock(&dev->mutex);
240 241
241 return err; 242 return err;
242} 243}
@@ -255,13 +256,13 @@ void input_close_device(struct input_handle *handle)
255 256
256 input_release_device(handle); 257 input_release_device(handle);
257 258
258 down(&dev->sem); 259 mutex_lock(&dev->mutex);
259 260
260 if (!--dev->users && dev->close) 261 if (!--dev->users && dev->close)
261 dev->close(dev); 262 dev->close(dev);
262 handle->open--; 263 handle->open--;
263 264
264 up(&dev->sem); 265 mutex_unlock(&dev->mutex);
265} 266}
266 267
267static void input_link_handle(struct input_handle *handle) 268static void input_link_handle(struct input_handle *handle)
@@ -512,13 +513,13 @@ static ssize_t input_dev_show_##name(struct class_device *dev, char *buf) \
512 struct input_dev *input_dev = to_input_dev(dev); \ 513 struct input_dev *input_dev = to_input_dev(dev); \
513 int retval; \ 514 int retval; \
514 \ 515 \
515 retval = down_interruptible(&input_dev->sem); \ 516 retval = mutex_lock_interruptible(&input_dev->mutex); \
516 if (retval) \ 517 if (retval) \
517 return retval; \ 518 return retval; \
518 \ 519 \
519 retval = sprintf(buf, "%s\n", input_dev->name ? input_dev->name : ""); \ 520 retval = sprintf(buf, "%s\n", input_dev->name ? input_dev->name : ""); \
520 \ 521 \
521 up(&input_dev->sem); \ 522 mutex_unlock(&input_dev->mutex); \
522 \ 523 \
523 return retval; \ 524 return retval; \
524} \ 525} \
@@ -790,7 +791,7 @@ int input_register_device(struct input_dev *dev)
790 return -EINVAL; 791 return -EINVAL;
791 } 792 }
792 793
793 init_MUTEX(&dev->sem); 794 mutex_init(&dev->mutex);
794 set_bit(EV_SYN, dev->evbit); 795 set_bit(EV_SYN, dev->evbit);
795 796
796 /* 797 /*