summaryrefslogtreecommitdiff
path: root/drivers/media/rc/rc-main.c
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2017-06-22 15:23:54 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-08-20 09:34:39 -0400
commit265a2988d202b3aba0bbbb4d828c66d3741d59db (patch)
treefd709730afc881d79b463dbb6119a38bdb24a225 /drivers/media/rc/rc-main.c
parentab45e85851829ebb4e233ba5e401affa4128a352 (diff)
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/rc-main.c')
-rw-r--r--drivers/media/rc/rc-main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index a9eba0013525..7387bd4d75b0 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -616,12 +616,12 @@ void rc_repeat(struct rc_dev *dev)
spin_lock_irqsave(&dev->keylock, flags);
- input_event(dev->input_dev, EV_MSC, MSC_SCAN, dev->last_scancode);
- input_sync(dev->input_dev);
-
if (!dev->keypressed)
goto out;
+ input_event(dev->input_dev, EV_MSC, MSC_SCAN, dev->last_scancode);
+ input_sync(dev->input_dev);
+
dev->keyup_jiffies = jiffies + msecs_to_jiffies(IR_KEYPRESS_TIMEOUT);
mod_timer(&dev->timer_keyup, dev->keyup_jiffies);