V4L/DVB: re-add enable/disable check to the IR decoders
authorMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 4 Apr 2010 17:45:04 +0000 (14:45 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 19 May 2010 15:56:59 +0000 (12:56 -0300)
A previous cleanup patch removed more than needed. Re-add the logic that
disable the decoders.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/IR/ir-nec-decoder.c
drivers/media/IR/ir-rc5-decoder.c

index 28d77356355679a5397a5049efdb212707066c58..9d1ada95aa724197ccac2c3470c2733f60e3f677 100644 (file)
@@ -142,6 +142,9 @@ static int ir_nec_decode(struct input_dev *input_dev,
        if (!data)
                return -EINVAL;
 
+       if (!data->enabled)
+               return 0;
+
        /* Except for the initial event, what matters is the previous bit */
        bit = (ev->type & IR_PULSE) ? 1 : 0;
 
index 61b58397a3c2a410e35dd154f8baf272d0c2ca47..4fb3ce410e2468487807d547951cf90fef5ae3b3 100644 (file)
@@ -153,6 +153,9 @@ static int ir_rc5_decode(struct input_dev *input_dev,
        if (!data)
                return -EINVAL;
 
+       if (!data->enabled)
+               return 0;
+
        /* Except for the initial event, what matters is the previous bit */
        bit = (ev->type & IR_PULSE) ? 1 : 0;