From: Sean Young Date: Fri, 9 Aug 2019 22:31:08 +0000 (-0300) Subject: media: imon_raw: prevent "nonsensical timing event of duration 0" X-Git-Tag: v5.4-rc1~145^2~111 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=494fce160f2dac6f78d4282b54942fe03de59641;p=thirdparty%2Fkernel%2Flinux.git media: imon_raw: prevent "nonsensical timing event of duration 0" Sometimes the device sends IR data which is all space, no pulses whatsoever. Add the end of this the driver will put the rc device into idle mode when it already is in idle mode. The following will be logged: rc rc0: nonsensical timing event of duration 0 rc rc0: two consecutive events of type space Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/rc/imon_raw.c b/drivers/media/rc/imon_raw.c index e6723993b4660..d4aedcf76418c 100644 --- a/drivers/media/rc/imon_raw.c +++ b/drivers/media/rc/imon_raw.c @@ -85,7 +85,7 @@ static void imon_ir_data(struct imon *imon) offset = bit; } while (offset > 0); - if (packet_no == 0x0a) { + if (packet_no == 0x0a && !imon->rcdev->idle) { ir_raw_event_set_idle(imon->rcdev, true); ir_raw_event_handle(imon->rcdev); }