aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2011-03-11 17:22:50 (GMT)
committerHans Verkuil <hverkuil@xs4all.nl>2011-03-11 17:22:50 (GMT)
commit23f06fe09d86a02e6425c625065dbf9e15f4a3f4 (patch)
tree07486e6263481ec4e18fa6bc32bb7aba011ff554
parentfdee6ef4328c33f4114ab3dda79b34644f9e90e5 (diff)
Update the rc-main.c patch.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
-rw-r--r--backports/v2.6.36_input_getkeycode.patch47
1 files changed, 29 insertions, 18 deletions
diff --git a/backports/v2.6.36_input_getkeycode.patch b/backports/v2.6.36_input_getkeycode.patch
index 392012f..54daa95 100644
--- a/backports/v2.6.36_input_getkeycode.patch
+++ b/backports/v2.6.36_input_getkeycode.patch
@@ -1,7 +1,7 @@
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
-@@ -318,37 +318,23 @@ static unsigned int ir_establish_scancod
+@@ -318,37 +318,23 @@
* This routine is used to handle evdev EVIOCSKEY ioctl.
*/
static int ir_setkeycode(struct input_dev *idev,
@@ -45,7 +45,7 @@ diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
out:
spin_unlock_irqrestore(&rc_map->lock, flags);
-@@ -436,42 +422,25 @@ static unsigned int ir_lookup_by_scancod
+@@ -436,48 +422,25 @@
* This routine is used to handle evdev EVIOCGKEY ioctl.
*/
static int ir_getkeycode(struct input_dev *idev,
@@ -71,29 +71,40 @@ diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
-
- index = ir_lookup_by_scancode(rc_map, scancode);
- }
-+ index = ir_lookup_by_scancode(rc_map, scancode);
-
- if (index >= rc_map->len) {
-- if (!(ke->flags & INPUT_KEYMAP_BY_INDEX))
-- IR_dprintk(1, "unknown key for scancode 0x%04x\n",
-- scancode);
+-
+- if (index < rc_map->len) {
+- entry = &rc_map->scan[index];
+-
+- ke->index = index;
+- ke->keycode = entry->keycode;
+- ke->len = sizeof(entry->scancode);
+- memcpy(ke->scancode, &entry->scancode, sizeof(entry->scancode));
+-
+- } else if (!(ke->flags & INPUT_KEYMAP_BY_INDEX)) {
+- /*
+- * We do not really know the valid range of scancodes
+- * so let's respond with KEY_RESERVED to anything we
+- * do not have mapping for [yet].
+- */
+- ke->index = index;
+- ke->keycode = KEY_RESERVED;
+- } else {
- retval = -EINVAL;
+- goto out;
+- }
++ index = ir_lookup_by_scancode(rc_map, scancode);
++
++ if (index >= rc_map->len) {
+ *keycode = KEY_RESERVED;
+ retval = 0;
- goto out;
- }
-
-- entry = &rc_map->scan[index];
--
-- ke->index = index;
-- ke->keycode = entry->keycode;
-- ke->len = sizeof(entry->scancode);
-- memcpy(ke->scancode, &entry->scancode, sizeof(entry->scancode));
++ goto out;
++ }
++
+ *keycode = rc_map->scan[index].keycode;
retval = 0;
-@@ -960,8 +929,8 @@ struct rc_dev *rc_allocate_device(void)
+@@ -966,8 +929,8 @@
return NULL;
}

Privacy Policy