From: Dmitry Torokhov Date: Sat, 24 Aug 2024 05:50:26 +0000 (-0700) Subject: Input: zforce_ts - simplify reporting of slot state X-Git-Tag: microblaze-v6.13~68^2~2^2~20 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=5e091a49da06a4a761a0319eb5d37a93f2268dec;p=linux-2.6-microblaze.git Input: zforce_ts - simplify reporting of slot state input_mt_report_slot_state() returns true if slot is active, so we can combine checks for point.state != STATE_UP. Tested-by: Andreas Kemnade # Tolino Shine2HD Link: https://lore.kernel.org/r/20240824055047.1706392-3-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c index ffbd55c6e1d4..350cec8508a3 100644 --- a/drivers/input/touchscreen/zforce_ts.c +++ b/drivers/input/touchscreen/zforce_ts.c @@ -386,10 +386,8 @@ static int zforce_touch_event(struct zforce_ts *ts, u8 *payload) /* the zforce id starts with "1", so needs to be decreased */ input_mt_slot(ts->input, point.id - 1); - input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, - point.state != STATE_UP); - - if (point.state != STATE_UP) { + if (input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, + point.state != STATE_UP)) { touchscreen_report_pos(ts->input, &ts->prop, point.coord_x, point.coord_y, true);