Commit 7b3aa714 authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab

media: lirc: no need to recalculate duration

This is code existed for when drivers would send less than the whole
buffer; no driver does this any more, so this is redundant. Drivers
should return -EINVAL if they cannot send the entire buffer.
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent a74b2bff
......@@ -347,15 +347,6 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
if (ret < 0)
goto out_kfree;
if (fh->send_mode == LIRC_MODE_SCANCODE) {
ret = n;
} else {
for (duration = i = 0; i < ret; i++)
duration += txbuf[i];
ret *= sizeof(unsigned int);
}
/*
* The lircd gap calculation expects the write function to
* wait for the actual IR signal to be transmitted before
......@@ -368,6 +359,7 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
schedule_timeout(usecs_to_jiffies(towait));
}
ret = n;
out_kfree:
kfree(txbuf);
kfree(raw);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment