summaryrefslogtreecommitdiffstats
path: root/drivers/input/evdev.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2007-11-04 00:41:12 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2008-01-21 01:11:06 -0500
commitf4f37c8ec7d2491c8885c890ba74254b9adfbeee (patch)
treeecd4cb10af7fd7aa4fb02fe2a106608e9d64c3fe /drivers/input/evdev.c
parent554101e3e5f396b987c846332863a3fcdc87b1d6 (diff)
downloadop-kernel-dev-f4f37c8ec7d2491c8885c890ba74254b9adfbeee.zip
op-kernel-dev-f4f37c8ec7d2491c8885c890ba74254b9adfbeee.tar.gz
Input: Add proper locking when changing device's keymap
Take dev->event_lock to make sure that we don't race with input_event() and also force key up event when removing a key from keymap table. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/evdev.c')
-rw-r--r--drivers/input/evdev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index e5b4e9b..0727b0a 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -617,7 +617,7 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
if (get_user(t, ip))
return -EFAULT;
- error = dev->getkeycode(dev, t, &v);
+ error = input_get_keycode(dev, t, &v);
if (error)
return error;
@@ -630,7 +630,7 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
if (get_user(t, ip) || get_user(v, ip + 1))
return -EFAULT;
- return dev->setkeycode(dev, t, v);
+ return input_set_keycode(dev, t, v);
case EVIOCSFF:
if (copy_from_user(&effect, p, sizeof(effect)))
@@ -683,7 +683,7 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
case EV_FF: bits = dev->ffbit; len = FF_MAX; break;
case EV_SW: bits = dev->swbit; len = SW_MAX; break;
default: return -EINVAL;
- }
+ }
return bits_to_user(bits, len, _IOC_SIZE(cmd), p, compat_mode);
}
OpenPOWER on IntegriCloud