summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/rc-ir-raw.c
diff options
context:
space:
mode:
authorJasmin Jessich <jasmin@anw.at>2017-08-25 11:59:41 +0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-08-31 11:35:18 +0200
commit800846c4d92f538c6640f83d9f9c0f44dac8ada7 (patch)
tree3e8572c0c0aee2d1e42c81e832cae4d525c5024d /drivers/media/rc/rc-ir-raw.c
parentmedia: max2175: Propagate the real error on devm_clk_get() failure (diff)
downloadlinux-800846c4d92f538c6640f83d9f9c0f44dac8ada7.tar.xz
linux-800846c4d92f538c6640f83d9f9c0f44dac8ada7.zip
media: rc: use ktime accessor functions
Prefer using accessor functions so we are not dependent on the ktime_t type. Signed-off-by: Jasmin Jessich <jasmin@anw.at> 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-ir-raw.c')
-rw-r--r--drivers/media/rc/rc-ir-raw.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c
index f495709e28fb..503bc425a187 100644
--- a/drivers/media/rc/rc-ir-raw.c
+++ b/drivers/media/rc/rc-ir-raw.c
@@ -106,7 +106,7 @@ int ir_raw_event_store_edge(struct rc_dev *dev, bool pulse)
return -EINVAL;
now = ktime_get();
- ev.duration = ktime_sub(now, dev->raw->last_event);
+ ev.duration = ktime_to_ns(ktime_sub(now, dev->raw->last_event));
ev.pulse = !pulse;
rc = ir_raw_event_store(dev, &ev);
@@ -474,18 +474,19 @@ EXPORT_SYMBOL(ir_raw_encode_scancode);
static void edge_handle(unsigned long arg)
{
struct rc_dev *dev = (struct rc_dev *)arg;
- ktime_t interval = ktime_get() - dev->raw->last_event;
+ ktime_t interval = ktime_sub(ktime_get(), dev->raw->last_event);
- if (interval >= dev->timeout) {
+ if (ktime_to_ns(interval) >= dev->timeout) {
DEFINE_IR_RAW_EVENT(ev);
ev.timeout = true;
- ev.duration = interval;
+ ev.duration = ktime_to_ns(interval);
ir_raw_event_store(dev, &ev);
} else {
mod_timer(&dev->raw->edge_handle,
- jiffies + nsecs_to_jiffies(dev->timeout - interval));
+ jiffies + nsecs_to_jiffies(dev->timeout -
+ ktime_to_ns(interval)));
}
ir_raw_event_handle(dev);