[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>
This commit is contained in:
parent
5c86275869
commit
bc989391ab
|
@ -253,6 +253,9 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd,
|
||||||
val);
|
val);
|
||||||
|
|
||||||
case LIRC_SET_REC_CARRIER_RANGE:
|
case LIRC_SET_REC_CARRIER_RANGE:
|
||||||
|
if (!dev->s_rx_carrier_range)
|
||||||
|
return -ENOTTY;
|
||||||
|
|
||||||
if (val <= 0)
|
if (val <= 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
@ -305,6 +308,9 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LIRC_SET_REC_TIMEOUT_REPORTS:
|
case LIRC_SET_REC_TIMEOUT_REPORTS:
|
||||||
|
if (!dev->timeout)
|
||||||
|
return -ENOTTY;
|
||||||
|
|
||||||
lirc->send_timeout_reports = !!val;
|
lirc->send_timeout_reports = !!val;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue