summaryrefslogtreecommitdiff
path: root/drivers/input/keyboard/bf54x-keys.c
diff options
context:
space:
mode:
authorAndrew Liu <andrew.liu200917@gmail.com>2013-11-23 10:06:36 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-11-25 18:26:17 -0800
commite4cfb034e89a1c7148f617735d92a3655d27773f (patch)
tree5fcd037bdae5695fa786ea691e671c57bb15f67b /drivers/input/keyboard/bf54x-keys.c
parent5cf0eb9875cb26ebdc60d08444272b2ea219386e (diff)
downloadlinux-next-e4cfb034e89a1c7148f617735d92a3655d27773f.tar.gz
Input: keyboard - "keycode & KEY_MAX" changes some keycode values
For exmaple, keycode: KEY_OK(0x160) is changed by "and" operation with KEY_MAX(0x2ff) to KEY_KPENTER(96). Signed-off-by: Andrew Liu <andrew.liu200917@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/keyboard/bf54x-keys.c')
-rw-r--r--drivers/input/keyboard/bf54x-keys.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/input/keyboard/bf54x-keys.c b/drivers/input/keyboard/bf54x-keys.c
index fc88fb48d70d..09b91d093087 100644
--- a/drivers/input/keyboard/bf54x-keys.c
+++ b/drivers/input/keyboard/bf54x-keys.c
@@ -289,7 +289,8 @@ static int bfin_kpad_probe(struct platform_device *pdev)
__set_bit(EV_REP, input->evbit);
for (i = 0; i < input->keycodemax; i++)
- __set_bit(bf54x_kpad->keycode[i] & KEY_MAX, input->keybit);
+ if (bf54x_kpad->keycode[i] <= KEY_MAX)
+ __set_bit(bf54x_kpad->keycode[i], input->keybit);
__clear_bit(KEY_RESERVED, input->keybit);
error = input_register_device(input);