diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2007-11-04 00:41:12 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-01-21 01:11:06 -0500 |
commit | f4f37c8ec7d2491c8885c890ba74254b9adfbeee (patch) | |
tree | ecd4cb10af7fd7aa4fb02fe2a106608e9d64c3fe /drivers/char | |
parent | 554101e3e5f396b987c846332863a3fcdc87b1d6 (diff) |
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/char')
-rw-r--r-- | drivers/char/keyboard.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index fc54d234507a..5218d0d0511e 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c | |||
@@ -194,7 +194,7 @@ int getkeycode(unsigned int scancode) | |||
194 | int error = -ENODEV; | 194 | int error = -ENODEV; |
195 | 195 | ||
196 | list_for_each_entry(handle, &kbd_handler.h_list, h_node) { | 196 | list_for_each_entry(handle, &kbd_handler.h_list, h_node) { |
197 | error = handle->dev->getkeycode(handle->dev, scancode, &keycode); | 197 | error = input_get_keycode(handle->dev, scancode, &keycode); |
198 | if (!error) | 198 | if (!error) |
199 | return keycode; | 199 | return keycode; |
200 | } | 200 | } |
@@ -208,7 +208,7 @@ int setkeycode(unsigned int scancode, unsigned int keycode) | |||
208 | int error = -ENODEV; | 208 | int error = -ENODEV; |
209 | 209 | ||
210 | list_for_each_entry(handle, &kbd_handler.h_list, h_node) { | 210 | list_for_each_entry(handle, &kbd_handler.h_list, h_node) { |
211 | error = handle->dev->setkeycode(handle->dev, scancode, keycode); | 211 | error = input_set_keycode(handle->dev, scancode, keycode); |
212 | if (!error) | 212 | if (!error) |
213 | break; | 213 | break; |
214 | } | 214 | } |