From 9f3a5f2187da077f3644e85e33ab3a4e5f94e076 Mon Sep 17 00:00:00 2001 From: Fenglin Wu Date: Thu, 6 Feb 2020 13:36:36 +0800 Subject: [PATCH] input: qcom-hv-haptics: correct pattern source checking logic The pattern source check before loading predefined effect is incorrect. Correct it. Change-Id: I8026f6ee24ce17dfe43bc514eeb526300af99746 Signed-off-by: Fenglin Wu --- drivers/input/misc/qcom-hv-haptics.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/misc/qcom-hv-haptics.c b/drivers/input/misc/qcom-hv-haptics.c index f2de3443779d..7b4283d757bc 100644 --- a/drivers/input/misc/qcom-hv-haptics.c +++ b/drivers/input/misc/qcom-hv-haptics.c @@ -884,8 +884,8 @@ static int haptics_load_predefined_effect(struct haptics_chip *chip, return rc; play->pattern_src = play->effect->src; - if (play->pattern_src != PATTERN1 || - play->pattern_src != PATTERN2 || + if (play->pattern_src != PATTERN1 && + play->pattern_src != PATTERN2 && play->pattern_src != FIFO) { dev_err(chip->dev, "pattern src %d can't be used for predefined effect\n", play->pattern_src);