diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-09-07 14:18:36 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-09-07 14:18:36 -0700 |
commit | 7e66eaf14e19c032433be7c4df3c892fa2a5282f (patch) | |
tree | 56b0d5f9d16eb18744e102f3f216715196cd62e6 /drivers/media/rc/rc-loopback.c | |
parent | d3654d7ef3adad0083525cfb6fe27be62cb83d0d (diff) | |
parent | c6a389f123b9f68d605bb7e0f9b32ec1e3e14132 (diff) |
Merge commit 'v3.1-rc4' into next
Diffstat (limited to 'drivers/media/rc/rc-loopback.c')
-rw-r--r-- | drivers/media/rc/rc-loopback.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/media/rc/rc-loopback.c b/drivers/media/rc/rc-loopback.c index cc846b2619c..efc6a514348 100644 --- a/drivers/media/rc/rc-loopback.c +++ b/drivers/media/rc/rc-loopback.c @@ -101,21 +101,14 @@ static int loop_set_rx_carrier_range(struct rc_dev *dev, u32 min, u32 max) return 0; } -static int loop_tx_ir(struct rc_dev *dev, int *txbuf, u32 n) +static int loop_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count) { struct loopback_dev *lodev = dev->priv; u32 rxmask; - unsigned count; unsigned total_duration = 0; unsigned i; DEFINE_IR_RAW_EVENT(rawir); - if (n == 0 || n % sizeof(int)) { - dprintk("invalid tx buffer size\n"); - return -EINVAL; - } - - count = n / sizeof(int); for (i = 0; i < count; i++) total_duration += abs(txbuf[i]); @@ -142,7 +135,7 @@ static int loop_tx_ir(struct rc_dev *dev, int *txbuf, u32 n) for (i = 0; i < count; i++) { rawir.pulse = i % 2 ? false : true; - rawir.duration = abs(txbuf[i]) * 1000; + rawir.duration = txbuf[i] * 1000; if (rawir.duration) ir_raw_event_store_with_filter(dev, &rawir); } @@ -158,7 +151,7 @@ out: /* Lirc expects this function to take as long as the total duration */ set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(usecs_to_jiffies(total_duration)); - return n; + return count; } static void loop_set_idle(struct rc_dev *dev, bool enable) |