summaryrefslogtreecommitdiff
path: root/drivers/media/rc/ir-lirc-codec.c
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2017-02-08 20:44:38 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-03-24 08:20:28 -0300
commitbc989391ab08ef75602a82cacf4fabc9f12095e5 (patch)
tree4f9e208c002b8f07f9c560b71fb503460db6f264 /drivers/media/rc/ir-lirc-codec.c
parent5c8627586942b0269f81e3296dabe9f049815779 (diff)
[media] lirc: return ENOTTY when device does support ioctl
If timeouts or carrier range is not supported, return proper error. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/rc/ir-lirc-codec.c')
-rw-r--r--drivers/media/rc/ir-lirc-codec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
index 637b583963e3..235d74adc3fd 100644
--- a/drivers/media/rc/ir-lirc-codec.c
+++ b/drivers/media/rc/ir-lirc-codec.c
@@ -253,6 +253,9 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd,
val);
case LIRC_SET_REC_CARRIER_RANGE:
+ if (!dev->s_rx_carrier_range)
+ return -ENOTTY;
+
if (val <= 0)
return -EINVAL;
@@ -305,6 +308,9 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd,
break;
case LIRC_SET_REC_TIMEOUT_REPORTS:
+ if (!dev->timeout)
+ return -ENOTTY;
+
lirc->send_timeout_reports = !!val;
break;