Skip to contentSkip to conversation

ir-core: Fix the delete logic

PATCH New Mauro Carvalho Chehab 1 participant 1 message Apr 11, 2010 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): ccda6144bee4797ab2f2524c4c4fe43c964c56e2.1270955959.git.mchehab@redhat.com

#1 lore raw

PATCH 2/2 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
drivers/media/IR/ir-keytable.c +1 -1
index 01bddc4..f0eb680 100644
@@ -126,7 +126,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;
Signature · 1 line
1.6.6.1