]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/keyboard.c
Input: drivers/char/keyboard.c - use time_after
[linux-2.6-omap-h63xx.git] / drivers / char / keyboard.c
index 4dbd3425e928ed563ff4954378147692deff7b94..45806d27579ab8bbc13f94d2f6865fa0b9b5b9e9 100644 (file)
@@ -42,6 +42,7 @@
 #include <linux/input.h>
 #include <linux/reboot.h>
 #include <linux/notifier.h>
+#include <linux/jiffies.h>
 
 extern void ctrl_alt_del(void);
 
@@ -928,7 +929,8 @@ static void k_brl(struct vc_data *vc, unsigned char value, char up_flag)
        if (up_flag) {
                if (brl_timeout) {
                        if (!committing ||
-                           jiffies - releasestart > (brl_timeout * HZ) / 1000) {
+                           time_after(jiffies,
+                                      releasestart + msecs_to_jiffies(brl_timeout))) {
                                committing = pressed;
                                releasestart = jiffies;
                        }
@@ -1237,6 +1239,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
        }
 
        param.shift = shift_final = (shift_state | kbd->slockstate) ^ kbd->lockstate;
+       param.ledstate = kbd->ledflagstate;
        key_map = key_maps[shift_final];
 
        if (atomic_notifier_call_chain(&keyboard_notifier_list, KBD_KEYCODE, &param) == NOTIFY_STOP || !key_map) {
@@ -1285,6 +1288,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
 
        (*k_handler[type])(vc, keysym & 0xff, !down);
 
+       param.ledstate = kbd->ledflagstate;
        atomic_notifier_call_chain(&keyboard_notifier_list, KBD_POST_KEYSYM, &param);
 
        if (type != KT_SLOCK)