diff options
author | Alan Cox <alan@linux.intel.com> | 2012-02-28 09:49:23 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-08 13:50:35 -0500 |
commit | 079c9534a96da9a85a2a2f9715851050fbfbf749 (patch) | |
tree | 0e3782ff6d341f38c6f0b3840cb3c8f2bc922df8 /drivers/accessibility/braille | |
parent | 0fb8379dab9f97e4c56de8f9ea772c10eda27561 (diff) |
vt:tackle kbd_table
Keyboard struct lifetime is easy, but the locking is not and is completely
ignored by the existing code. Tackle this one head on
- Make the kbd_table private so we can run down all direct users
- Hoick the relevant ioctl handlers into the keyboard layer
- Lock them with the keyboard lock so they don't change mid keypress
- Add helpers for things like console stop/start so we isolate the poking
around properly
- Tweak the braille console so it still builds
There are a couple of FIXME locking cases left for ioctls that are so hideous
they should be addressed in a later patch. After this patch the kbd_table is
private and all the keyboard jiggery pokery is in one place.
This update fixes speakup and also a memory leak in the original.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/accessibility/braille')
-rw-r--r-- | drivers/accessibility/braille/braille_console.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/accessibility/braille/braille_console.c b/drivers/accessibility/braille/braille_console.c index c339a0880e6e..d21167bfc865 100644 --- a/drivers/accessibility/braille/braille_console.c +++ b/drivers/accessibility/braille/braille_console.c | |||
@@ -244,16 +244,13 @@ static int keyboard_notifier_call(struct notifier_block *blk, | |||
244 | 244 | ||
245 | switch (val) { | 245 | switch (val) { |
246 | case KVAL(K_CAPS): | 246 | case KVAL(K_CAPS): |
247 | on_off = vc_kbd_led(kbd_table + fg_console, | 247 | on_off = vt_get_leds(fg_console, VC_CAPSLOCK); |
248 | VC_CAPSLOCK); | ||
249 | break; | 248 | break; |
250 | case KVAL(K_NUM): | 249 | case KVAL(K_NUM): |
251 | on_off = vc_kbd_led(kbd_table + fg_console, | 250 | on_off = vt_get_leds(fg_console, VC_NUMLOCK); |
252 | VC_NUMLOCK); | ||
253 | break; | 251 | break; |
254 | case KVAL(K_HOLD): | 252 | case KVAL(K_HOLD): |
255 | on_off = vc_kbd_led(kbd_table + fg_console, | 253 | on_off = vt_get_leds(fg_console, VC_SCROLLOCK); |
256 | VC_SCROLLOCK); | ||
257 | break; | 254 | break; |
258 | } | 255 | } |
259 | if (on_off == 1) | 256 | if (on_off == 1) |