summaryrefslogtreecommitdiff
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2017-01-19 19:44:00 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-01-31 07:30:22 -0200
commitf348b4d323a67a5639ccbd3de5add5383573e4a5 (patch)
treeb10568789831bc5e3caf9547001c48a8a895a6a6 /drivers/media/rc
parent8caebcdc53c9716ed6ae493aa6c0b1d3a67f0d5d (diff)
[media] lirc: LIRC_GET_MIN_TIMEOUT should be in range
LIRC_SET_REC_TIMEOUT can fail if the value returned by LIRC_GET_MIN_TIMEOUT is set due to rounding errors. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r--drivers/media/rc/ir-lirc-codec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
index e944507fc4f5..8517d5153fcf 100644
--- a/drivers/media/rc/ir-lirc-codec.c
+++ b/drivers/media/rc/ir-lirc-codec.c
@@ -279,7 +279,7 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd,
case LIRC_GET_MIN_TIMEOUT:
if (!dev->max_timeout)
return -ENOSYS;
- val = dev->min_timeout / 1000;
+ val = DIV_ROUND_UP(dev->min_timeout, 1000);
break;
case LIRC_GET_MAX_TIMEOUT: