Commit 1df896aa authored by Patrick Boettcher's avatar Patrick Boettcher Committed by Linus Torvalds

[PATCH] dvb: usb: IR input fixes

o fixed usage of the correct number of events in keymapping-array
o better place for return
Signed-off-by: default avatarPatrick Boettcher <pb@linuxtv.org>
Signed-off-by: default avatarJohannes Stezenbach <js@linuxtv.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 04f3e5ea
...@@ -39,7 +39,7 @@ static void dvb_usb_read_remote_control(void *data) ...@@ -39,7 +39,7 @@ static void dvb_usb_read_remote_control(void *data)
d->last_event = event; d->last_event = event;
case REMOTE_KEY_REPEAT: case REMOTE_KEY_REPEAT:
deb_rc("key repeated\n"); deb_rc("key repeated\n");
input_event(&d->rc_input_dev, EV_KEY, event, 1); input_event(&d->rc_input_dev, EV_KEY, d->last_event, 1);
input_event(&d->rc_input_dev, EV_KEY, d->last_event, 0); input_event(&d->rc_input_dev, EV_KEY, d->last_event, 0);
input_sync(&d->rc_input_dev); input_sync(&d->rc_input_dev);
break; break;
...@@ -160,12 +160,12 @@ int dvb_usb_nec_rc_key_to_event(struct dvb_usb_device *d, ...@@ -160,12 +160,12 @@ int dvb_usb_nec_rc_key_to_event(struct dvb_usb_device *d,
break; break;
} }
/* See if we can match the raw key code. */ /* See if we can match the raw key code. */
for (i = 0; i < sizeof(keymap)/sizeof(struct dvb_usb_rc_key); i++) for (i = 0; i < d->props.rc_key_map_size; i++)
if (keymap[i].custom == keybuf[1] && if (keymap[i].custom == keybuf[1] &&
keymap[i].data == keybuf[3]) { keymap[i].data == keybuf[3]) {
*event = keymap[i].event; *event = keymap[i].event;
*state = REMOTE_KEY_PRESSED; *state = REMOTE_KEY_PRESSED;
break; return 0;
} }
deb_err("key mapping failed - no appropriate key found in keymapping\n"); deb_err("key mapping failed - no appropriate key found in keymapping\n");
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment