Input: matrix_keypad - use flush_delayed_work()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 7 Feb 2019 22:39:40 +0000 (14:39 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 9 Feb 2019 17:00:03 +0000 (09:00 -0800)
We should be using flush_delayed_work() instead of flush_work() in
matrix_keypad_stop() to ensure that we are not missing work that is
scheduled but not yet put in the workqueue (i.e. its delay timer has not
expired yet).

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/matrix_keypad.c

index 403452ef00e6f257d67ca44bdf5626b0e5cc53a4..3d1cb7bf5e35feba1b355cef7e81c657db97be07 100644 (file)
@@ -222,7 +222,7 @@ static void matrix_keypad_stop(struct input_dev *dev)
        keypad->stopped = true;
        spin_unlock_irq(&keypad->lock);
 
-       flush_work(&keypad->work.work);
+       flush_delayed_work(&keypad->work);
        /*
         * matrix_keypad_scan() will leave IRQs enabled;
         * we should disable them now.