Input: keyboard - switch to using pr_err() and friends
[deliverable/linux.git] / drivers / char / keyboard.c
index ada25bb8941e5c0fa28ff068f66b0e14be700c55..157f23ad434fda8fb3d9f9f8fc89b526a6343c40 100644 (file)
@@ -24,6 +24,8 @@
  * 21-08-02: Converted to input API, major cleanup. (Vojtech Pavlik)
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/consolemap.h>
 #include <linux/module.h>
 #include <linux/sched.h>
@@ -38,7 +40,6 @@
 #include <linux/kbd_kern.h>
 #include <linux/kbd_diacr.h>
 #include <linux/vt_kern.h>
-#include <linux/sysrq.h>
 #include <linux/input.h>
 #include <linux/reboot.h>
 #include <linux/notifier.h>
@@ -82,8 +83,7 @@ void compute_shiftstate(void);
 typedef void (k_handler_fn)(struct vc_data *vc, unsigned char value,
                            char up_flag);
 static k_handler_fn K_HANDLERS;
-k_handler_fn *k_handler[16] = { K_HANDLERS };
-EXPORT_SYMBOL_GPL(k_handler);
+static k_handler_fn *k_handler[16] = { K_HANDLERS };
 
 #define FN_HANDLERS\
        fn_null,        fn_enter,       fn_show_ptregs, fn_show_mem,\
@@ -147,22 +147,6 @@ static struct ledptr {
        unsigned char valid:1;
 } ledptrs[3];
 
-/* Simple translation table for the SysRq keys */
-
-#ifdef CONFIG_MAGIC_SYSRQ
-unsigned char kbd_sysrq_xlate[KEY_MAX + 1] =
-        "\000\0331234567890-=\177\t"                    /* 0x00 - 0x0f */
-        "qwertyuiop[]\r\000as"                          /* 0x10 - 0x1f */
-        "dfghjkl;'`\000\\zxcv"                          /* 0x20 - 0x2f */
-        "bnm,./\000*\000 \000\201\202\203\204\205"      /* 0x30 - 0x3f */
-        "\206\207\210\211\212\000\000789-456+1"         /* 0x40 - 0x4f */
-        "230\177\000\000\213\214\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */
-        "\r\000/";                                      /* 0x60 - 0x6f */
-static int sysrq_down;
-static int sysrq_alt_use;
-#endif
-static int sysrq_alt;
-
 /*
  * Notifier list for console keyboard events
  */
@@ -657,7 +641,7 @@ static void k_spec(struct vc_data *vc, unsigned char value, char up_flag)
 
 static void k_lowercase(struct vc_data *vc, unsigned char value, char up_flag)
 {
-       printk(KERN_ERR "keyboard.c: k_lowercase was called - impossible\n");
+       pr_err("k_lowercase was called - impossible\n");
 }
 
 static void k_unicode(struct vc_data *vc, unsigned int value, char up_flag)
@@ -732,7 +716,7 @@ static void k_fn(struct vc_data *vc, unsigned char value, char up_flag)
                if (func_table[value])
                        puts_queue(vc, func_table[value]);
        } else
-               printk(KERN_ERR "k_fn called with value=%d\n", value);
+               pr_err("k_fn called with value=%d\n", value);
 }
 
 static void k_cur(struct vc_data *vc, unsigned char value, char up_flag)
@@ -930,7 +914,7 @@ static void k_brl(struct vc_data *vc, unsigned char value, char up_flag)
 
        if (kbd->kbdmode != VC_UNICODE) {
                if (!up_flag)
-                       printk("keyboard mode must be unicode for braille patterns\n");
+                       pr_warning("keyboard mode must be unicode for braille patterns\n");
                return;
        }
 
@@ -1108,7 +1092,8 @@ static int emulate_raw(struct vc_data *vc, unsigned int keycode,
                         * pressing PrtSc/SysRq alone, but simply 0x54
                         * when pressing Alt+PrtSc/SysRq.
                         */
-                       if (sysrq_alt) {
+                       if (test_bit(KEY_LEFTALT, key_down) ||
+                           test_bit(KEY_RIGHTALT, key_down)) {
                                put_queue(vc, 0x54 | up_flag);
                        } else {
                                put_queue(vc, 0xe0);
@@ -1176,8 +1161,6 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
 
        kbd = kbd_table + vc->vc_num;
 
-       if (keycode == KEY_LEFTALT || keycode == KEY_RIGHTALT)
-               sysrq_alt = down ? keycode : 0;
 #ifdef CONFIG_SPARC
        if (keycode == KEY_STOP)
                sparc_l1_a_state = down;
@@ -1188,23 +1171,9 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
        if ((raw_mode = (kbd->kbdmode == VC_RAW)) && !hw_raw)
                if (emulate_raw(vc, keycode, !down << 7))
                        if (keycode < BTN_MISC && printk_ratelimit())
-                               printk(KERN_WARNING "keyboard.c: can't emulate rawmode for keycode %d\n", keycode);
+                               pr_warning("can't emulate rawmode for keycode %d\n",
+                                          keycode);
 
-#ifdef CONFIG_MAGIC_SYSRQ             /* Handle the SysRq Hack */
-       if (keycode == KEY_SYSRQ && (sysrq_down || (down == 1 && sysrq_alt))) {
-               if (!sysrq_down) {
-                       sysrq_down = down;
-                       sysrq_alt_use = sysrq_alt;
-               }
-               return;
-       }
-       if (sysrq_down && !down && keycode == sysrq_alt_use)
-               sysrq_down = 0;
-       if (sysrq_down && down && !rep) {
-               handle_sysrq(kbd_sysrq_xlate[keycode], tty);
-               return;
-       }
-#endif
 #ifdef CONFIG_SPARC
        if (keycode == KEY_A && sparc_l1_a_state) {
                sparc_l1_a_state = 0;
This page took 0.04229 seconds and 5 git commands to generate.