[media] lirc_dev: use LIRC_CAN_REC() define to check if the device can receive
authorAndi Shyti <andi.shyti@samsung.com>
Wed, 6 Jul 2016 09:01:27 +0000 (06:01 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 13 Jul 2016 18:29:03 +0000 (15:29 -0300)
The LIRC_CAN_REC() returns a boolean "flag & LIRC_CAN_REC_MASK"
to check whether the device can receive data.

Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/rc/lirc_dev.c

index a107ab6bcb882bca16371f2a164da53d0dd9b95f..91f9bb87ce688d7470f80f6145b2b2bad191ebe4 100644 (file)
@@ -589,7 +589,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 (!(ir->d.features & LIRC_CAN_REC_MASK)) {
+               if (LIRC_CAN_REC(ir->d.features)) {
                        result = -ENOTTY;
                        break;
                }
@@ -599,7 +599,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 (!(ir->d.features & LIRC_CAN_REC_MASK)) {
+               if (LIRC_CAN_REC(ir->d.features)) {
                        result = -ENOTTY;
                        break;
                }