From 09bd00e7e12bbc9ca0ba20e0511995cddd3c93b9 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 11 Apr 2010 00:26:23 -0300 Subject: ir-core: Fix the delete logic Instead of removing an entry, the logic were doing both a deletion and a key addition, as shown by the log: [11517.323314] ir_getkeycode: unknown key for scancode 0x0050 [11517.326529] ir_do_setkeycode: #80: Deleting scan 0x0050 [11517.326529] ir_do_setkeycode: #80: New scan 0x0050 with key 0x0000 [11517.340598] ir_getkeycode: unknown key for scancode 0x0051 [11517.343811] ir_do_setkeycode: #81: Deleting scan 0x0051 [11517.343811] ir_do_setkeycode: #81: New scan 0x0051 with key 0x0000 [11517.357889] ir_getkeycode: unknown key for scancode 0x0052 [11517.361104] ir_do_setkeycode: #82: Deleting scan 0x0052 [11517.361104] ir_do_setkeycode: #82: New scan 0x0052 with key 0x0000 [11517.375453] ir_getkeycode: unknown key for scancode 0x0053 [11517.378474] ir_do_setkeycode: #83: Deleting scan 0x0053 [11517.378474] ir_do_setkeycode: #83: New scan 0x0053 with key 0x0000 Signed-off-by: Mauro Carvalho Chehab --- drivers/media/IR/ir-keytable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/IR/ir-keytable.c') diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c index 599e39c3444..1bb4e32f3dc 100644 --- a/drivers/media/IR/ir-keytable.c +++ b/drivers/media/IR/ir-keytable.c @@ -127,7 +127,7 @@ static int ir_do_setkeycode(struct input_dev *dev, break; } - if (old_keycode == KEY_RESERVED) { + if (old_keycode == KEY_RESERVED && keycode != KEY_RESERVED) { /* No previous mapping found, we might need to grow the table */ if (ir_resize_table(rc_tab)) return -ENOMEM; -- cgit v1.2.3-70-g09d2