[media] lirc: fix transmit-only read features
authorSean Young <sean@mess.org>
Thu, 19 Jan 2017 21:27:17 +0000 (19:27 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 31 Jan 2017 09:28:18 +0000 (07:28 -0200)
An RC device which is transmit-only shouldn't have the
LIRC_CAN_REC_MODE2 feature.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/rc/ir-lirc-codec.c

index 9e41305ad32e291abf22f95b815d6d1a22b6be12..e944507fc4f5c11e3003b184f16be6bd320e5e09 100644 (file)
@@ -347,7 +347,7 @@ static int ir_lirc_register(struct rc_dev *dev)
        struct lirc_driver *drv;
        struct lirc_buffer *rbuf;
        int rc = -ENOMEM;
-       unsigned long features;
+       unsigned long features = 0;
 
        drv = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL);
        if (!drv)
@@ -361,7 +361,8 @@ static int ir_lirc_register(struct rc_dev *dev)
        if (rc)
                goto rbuf_init_failed;
 
-       features = LIRC_CAN_REC_MODE2;
+       if (dev->driver_type != RC_DRIVER_IR_RAW_TX)
+               features |= LIRC_CAN_REC_MODE2;
        if (dev->tx_ir) {
                features |= LIRC_CAN_SEND_PULSE;
                if (dev->s_tx_mask)