[media] lirc_dev: LIRC_{G,S}ET_REC_MODE do not work
authorSean Young <sean@mess.org>
Fri, 2 Dec 2016 17:16:08 +0000 (15:16 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 30 Jan 2017 13:52:28 +0000 (11:52 -0200)
Since "273b902 [media] lirc_dev: use LIRC_CAN_REC() define" these
ioctls no longer work.

Signed-off-by: Sean Young <sean@mess.org>
Cc: <stable@vger.kernel.org> # v4.8+
Reviewed-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/rc/lirc_dev.c

index d71a41a..e0e2297 100644 (file)
@@ -578,7 +578,7 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                result = put_user(ir->d.features, (__u32 __user *)arg);
                break;
        case LIRC_GET_REC_MODE:
-               if (LIRC_CAN_REC(ir->d.features)) {
+               if (!LIRC_CAN_REC(ir->d.features)) {
                        result = -ENOTTY;
                        break;
                }
@@ -588,7 +588,7 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                                  (__u32 __user *)arg);
                break;
        case LIRC_SET_REC_MODE:
-               if (LIRC_CAN_REC(ir->d.features)) {
+               if (!LIRC_CAN_REC(ir->d.features)) {
                        result = -ENOTTY;
                        break;
                }