OSDN Git Service

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 28d7735..9d1ada9 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 61b5839..4fb3ce4 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;