summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorAndi Shyti <andi.shyti@samsung.com>2016-07-06 12:01:20 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-07-13 21:09:05 +0300
commit6ab86d2aa04375167c0e168eecb672acaf3d991a (patch)
treeb643dbbae2832b12a77738e41704e7b35f838441 /drivers/media
parent19e565397cb92b0484c46c48498e0fe2d2491efa (diff)
downloadlinux-6ab86d2aa04375167c0e168eecb672acaf3d991a.tar.xz
[media] lirc_dev: remove double if ... else statement
There are two if ... else which check the same thing in different part of the code, they can be merged in a single check. Signed-off-by: Andi Shyti <andi.shyti@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/rc/lirc_dev.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index c2826a7b70bd..a8a5116d9669 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -310,13 +310,6 @@ static int lirc_allocate_driver(struct lirc_driver *d)
irctls[minor] = ir;
d->minor = minor;
- if (d->sample_rate) {
- ir->jiffies_to_wait = HZ / d->sample_rate;
- } else {
- /* it means - wait for external event in task queue */
- ir->jiffies_to_wait = 0;
- }
-
/* some safety check 8-) */
d->name[sizeof(d->name)-1] = '\0';
@@ -330,6 +323,8 @@ static int lirc_allocate_driver(struct lirc_driver *d)
"lirc%u", ir->d.minor);
if (d->sample_rate) {
+ ir->jiffies_to_wait = HZ / d->sample_rate;
+
/* try to fire up polling thread */
ir->task = kthread_run(lirc_thread, (void *)ir, "lirc_dev");
if (IS_ERR(ir->task)) {
@@ -338,6 +333,9 @@ static int lirc_allocate_driver(struct lirc_driver *d)
err = -ECHILD;
goto out_sysfs;
}
+ } else {
+ /* it means - wait for external event in task queue */
+ ir->jiffies_to_wait = 0;
}
err = lirc_cdev_add(ir);