[media] au0828: avoid race conditions at RC stop
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Fri, 8 Aug 2014 10:27:20 +0000 (07:27 -0300)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 03:00:26 +0000 (12:00 +0900)
As the RC kthread can re-enable IR int, we should first
cancel the kthread and then disable IR int.

While here, remove a temporary debug printk.

Change-Id: I36ab0a218c0f88c39b023e7bd0eed7b7bdbc2d0c
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/usb/au0828/au0828-input.c

index fcb9065..7e6f4ab 100644 (file)
@@ -253,10 +253,10 @@ static void au0828_rc_stop(struct rc_dev *rc)
 {
        struct au0828_rc *ir = rc->priv;
 
+       cancel_delayed_work_sync(&ir->work);
+
        /* Disable IR */
        au8522_rc_clear(ir, 0xe0, 1 << 4);
-
-       cancel_delayed_work_sync(&ir->work);
 }
 
 static int au0828_probe_i2c_ir(struct au0828_dev *dev)