[PATCH 5.9 564/757] Input: stmfts - fix a & vs && typo

From: Greg Kroah-Hartman
Date: Tue Oct 27 2020 - 12:40:03 EST


From: YueHaibing <yuehaibing@xxxxxxxxxx>

[ Upstream commit d04afe14b23651e7a8bc89727a759e982a8458e4 ]

In stmfts_sysfs_hover_enable_write(), we should check value and
sdata->hover_enabled is all true.

Fixes: 78bcac7b2ae1 ("Input: add support for the STMicroelectronics FingerTip touchscreen")
Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>
Link: https://lore.kernel.org/r/20200916141941.16684-1-yuehaibing@xxxxxxxxxx
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/input/touchscreen/stmfts.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/stmfts.c b/drivers/input/touchscreen/stmfts.c
index df946869d4cd1..9a64e1dbc04ad 100644
--- a/drivers/input/touchscreen/stmfts.c
+++ b/drivers/input/touchscreen/stmfts.c
@@ -479,7 +479,7 @@ static ssize_t stmfts_sysfs_hover_enable_write(struct device *dev,

mutex_lock(&sdata->mutex);

- if (value & sdata->hover_enabled)
+ if (value && sdata->hover_enabled)
goto out;

if (sdata->running)
--
2.25.1