Skip to content

Commit

Permalink
[media] rc-ir-raw: do not generate any receiving thread for raw trans…
Browse files Browse the repository at this point in the history
…mitters

Raw IR transmitters do not need any thread listening for
occurring events. Check the driver type before running the
thread.

Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
  • Loading branch information
Andi Shyti authored and Mauro Carvalho Chehab committed Jan 30, 2017
1 parent d34aee1 commit d508367
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions drivers/media/rc/rc-ir-raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,18 @@ int ir_raw_event_register(struct rc_dev *dev)
dev->change_protocol = change_protocol;
INIT_KFIFO(dev->raw->kfifo);

dev->raw->thread = kthread_run(ir_raw_event_thread, dev->raw,
"rc%u", dev->minor);
/*
* raw transmitters do not need any event registration
* because the event is coming from userspace
*/
if (dev->driver_type != RC_DRIVER_IR_RAW_TX) {
dev->raw->thread = kthread_run(ir_raw_event_thread, dev->raw,
"rc%u", dev->minor);

if (IS_ERR(dev->raw->thread)) {
rc = PTR_ERR(dev->raw->thread);
goto out;
if (IS_ERR(dev->raw->thread)) {
rc = PTR_ERR(dev->raw->thread);
goto out;
}
}

mutex_lock(&ir_raw_handler_lock);
Expand Down

0 comments on commit d508367

Please sign in to comment.