From: Sean Young Date: Thu, 19 Jan 2017 21:27:17 +0000 (-0200) Subject: [media] lirc: fix transmit-only read features X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c9bbd5661fa85e086ee52aa5905b62d14ee8b7a3;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [media] lirc: fix transmit-only read features An RC device which is transmit-only shouldn't have the LIRC_CAN_REC_MODE2 feature. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c index 9e41305ad32e..e944507fc4f5 100644 --- a/drivers/media/rc/ir-lirc-codec.c +++ b/drivers/media/rc/ir-lirc-codec.c @@ -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)