diff options
Diffstat (limited to 'drivers/staging/media/lirc/lirc_imon.c')
-rw-r--r-- | drivers/staging/media/lirc/lirc_imon.c | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/drivers/staging/media/lirc/lirc_imon.c b/drivers/staging/media/lirc/lirc_imon.c index 7aca44f28c5a..9ce7d9990e3e 100644 --- a/drivers/staging/media/lirc/lirc_imon.c +++ b/drivers/staging/media/lirc/lirc_imon.c @@ -495,7 +495,7 @@ static int ir_open(void *data) /* prevent races with disconnect */ mutex_lock(&driver_lock); - context = (struct imon_context *)data; + context = data; /* initial IR protocol decode variables */ context->rx.count = 0; @@ -516,7 +516,7 @@ static void ir_close(void *data) { struct imon_context *context; - context = (struct imon_context *)data; + context = data; if (!context) { pr_err("%s: no context for device\n", __func__); return; @@ -572,29 +572,6 @@ static void submit_data(struct imon_context *context) wake_up(&context->driver->rbuf->wait_poll); } -static inline int tv2int(const struct timeval *a, const struct timeval *b) -{ - int usecs = 0; - int sec = 0; - - if (b->tv_usec > a->tv_usec) { - usecs = 1000000; - sec--; - } - - usecs += a->tv_usec - b->tv_usec; - - sec += a->tv_sec - b->tv_sec; - sec *= 1000; - usecs /= 1000; - sec += usecs; - - if (sec < 0) - sec = 1000; - - return sec; -} - /** * Process the incoming packet */ @@ -606,7 +583,6 @@ static void imon_incoming_packet(struct imon_context *context, struct device *dev = context->driver->dev; int octet, bit; unsigned char mask; - int i; /* * just bail out if no listening IR client @@ -620,13 +596,8 @@ static void imon_incoming_packet(struct imon_context *context, return; } - if (debug) { - dev_info(dev, "raw packet: "); - for (i = 0; i < len; ++i) - printk("%02x ", buf[i]); - printk("\n"); - } - + if (debug) + dev_info(dev, "raw packet: %*ph\n", len, buf); /* * Translate received data to pulse and space lengths. * Received data is active low, i.e. pulses are 0 and |