diff options
author | David Härdeman <david@hardeman.nu> | 2017-06-22 21:23:54 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-08-20 15:34:39 +0200 |
commit | 265a2988d202b3aba0bbbb4d828c66d3741d59db (patch) | |
tree | fd709730afc881d79b463dbb6119a38bdb24a225 /drivers/media/rc/ir-nec-decoder.c | |
parent | media: v4l: vsp1: Allow entities to participate in the partition algorithm (diff) | |
download | linux-265a2988d202b3aba0bbbb4d828c66d3741d59db.tar.xz linux-265a2988d202b3aba0bbbb4d828c66d3741d59db.zip |
media: rc-core: consistent use of rc_repeat()
The NEC decoder and the Sanyo decoders check if dev->keypressed is true
before calling rc_repeat (without holding dev->keylock).
Meanwhile, the XMP and JVC decoders do no such checks.
This patch makes sure all users of rc_repeat() do so consistently by
removing extra checks in NEC/Sanyo and modifying the check a bit in
rc_repeat() so that no input event is generated if the key isn't pressed.
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/rc/ir-nec-decoder.c')
-rw-r--r-- | drivers/media/rc/ir-nec-decoder.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/media/rc/ir-nec-decoder.c b/drivers/media/rc/ir-nec-decoder.c index 3ce850314dca..75b9137f6faf 100644 --- a/drivers/media/rc/ir-nec-decoder.c +++ b/drivers/media/rc/ir-nec-decoder.c @@ -88,13 +88,9 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev) data->state = STATE_BIT_PULSE; return 0; } else if (eq_margin(ev.duration, NEC_REPEAT_SPACE, NEC_UNIT / 2)) { - if (!dev->keypressed) { - IR_dprintk(1, "Discarding last key repeat: event after key up\n"); - } else { - rc_repeat(dev); - IR_dprintk(1, "Repeat last key\n"); - data->state = STATE_TRAILER_PULSE; - } + rc_repeat(dev); + IR_dprintk(1, "Repeat last key\n"); + data->state = STATE_TRAILER_PULSE; return 0; } |