Input: twl6040-vibra - ignore return value of schedule_work
authorH. Nikolaus Schaller <hns@goldelico.com>
Mon, 18 Apr 2016 21:47:14 +0000 (14:47 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 19 Apr 2016 16:24:21 +0000 (09:24 -0700)
Returning ret is wrong. And checking for an error as well. User space
may call multiple times until the work is really scheduled.

twl4030-vibra.c also ignores the return value.

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/twl6040-vibra.c

index 3a196ada689261cf42dff7a28cc6b5001cc92800..0c853c2c57f81496eba6175929a660ee8cf66b73 100644 (file)
@@ -212,11 +212,7 @@ static int vibra_play(struct input_dev *input, void *data,
        info->strong_speed = effect->u.rumble.strong_magnitude;
        info->direction = effect->direction < EFFECT_DIR_180_DEG ? 1 : -1;
 
-       ret = schedule_work(&info->play_work);
-       if (!ret) {
-               dev_info(&input->dev, "work is already on queue\n");
-               return ret;
-       }
+       schedule_work(&info->play_work);
 
        return 0;
 }