提交 07e9293c 编写于 作者: S Sean Young 提交者: Mauro Carvalho Chehab

[media] lirc: LIRC_{G,S}ET_SEND_MODE fail if device cannot transmit

These ioctls should not succeed if the device cannot send. Also make it
clear that these ioctls should return the lirc mode, although the actual
value does not change.
Signed-off-by: NSean Young <sean@mess.org>
Reviewed-by: NAndi Shyti <andi.shyti@samsung.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 bd291208
......@@ -204,11 +204,17 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd,
/* legacy support */
case LIRC_GET_SEND_MODE:
val = LIRC_CAN_SEND_PULSE & LIRC_CAN_SEND_MASK;
if (!dev->tx_ir)
return -ENOTTY;
val = LIRC_MODE_PULSE;
break;
case LIRC_SET_SEND_MODE:
if (val != (LIRC_MODE_PULSE & LIRC_CAN_SEND_MASK))
if (!dev->tx_ir)
return -ENOTTY;
if (val != LIRC_MODE_PULSE)
return -EINVAL;
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册