Skip to content

Commit

Permalink
[media] m920x: avoid repeating RC state parsing at each keycode
Browse files Browse the repository at this point in the history
Parsing the RC press state is invariant wrt. the keycode, take it out of
the keycode scanning loop.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Antonio Ospite authored and Mauro Carvalho Chehab committed Dec 27, 2012
1 parent f526e9e commit 7a7ef46
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/media/usb/dvb-usb/m920x.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,11 @@ static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_KEY, rc_state + 1, 1)) != 0)
goto out;

m920x_parse_rc_state(d, rc_state[0], state);

for (i = 0; i < d->props.rc.legacy.rc_map_size; i++)
if (rc5_data(&d->props.rc.legacy.rc_map_table[i]) == rc_state[1]) {
*event = d->props.rc.legacy.rc_map_table[i].keycode;
m920x_parse_rc_state(d, rc_state[0], state);
goto out;
}

Expand Down

0 comments on commit 7a7ef46

Please sign in to comment.