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: Sean Young <sean@mess.org>
Reviewed-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
 
        /* 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;