linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: alps - Propagate alps_passthrough_mode_v2() errors in alps_poll()
@ 2025-03-03 11:07 Wentao Liang
  2025-03-07 17:54 ` Markus Elfring
  0 siblings, 1 reply; 2+ messages in thread
From: Wentao Liang @ 2025-03-03 11:07 UTC (permalink / raw)
  To: pali, dmitry.torokhov
  Cc: erick.archer, linux-input, linux-kernel, Wentao Liang

Add error handling to propagate alps_passthrough_mode_v2() failures
to the caller. When alps_passthrough_mode_v2() fails, immediately
return -1 to stop further processing and maintain consistent error
reporting.

Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/input/mouse/alps.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 0728b5c08f02..557de3d0fce6 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -1994,14 +1994,16 @@ static int alps_poll(struct psmouse *psmouse)
 	unsigned char buf[sizeof(psmouse->packet)];
 	bool poll_failed;
 
-	if (priv->flags & ALPS_PASS)
-		alps_passthrough_mode_v2(psmouse, true);
+	if ((priv->flags & ALPS_PASS) &&
+		alps_passthrough_mode_v2(psmouse, true))
+		return -1;
 
 	poll_failed = ps2_command(&psmouse->ps2dev, buf,
 				  PSMOUSE_CMD_POLL | (psmouse->pktsize << 8)) < 0;
 
-	if (priv->flags & ALPS_PASS)
-		alps_passthrough_mode_v2(psmouse, false);
+	if ((priv->flags & ALPS_PASS) &&
+		alps_passthrough_mode_v2(psmouse, false))
+		return -1;
 
 	if (poll_failed || (buf[0] & priv->mask0) != priv->byte0)
 		return -1;
-- 
2.42.0.windows.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Input: alps - Propagate alps_passthrough_mode_v2() errors in alps_poll()
  2025-03-03 11:07 [PATCH] Input: alps - Propagate alps_passthrough_mode_v2() errors in alps_poll() Wentao Liang
@ 2025-03-07 17:54 ` Markus Elfring
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2025-03-07 17:54 UTC (permalink / raw)
  To: vulab, linux-input; +Cc: LKML, Dmitry Torokhov, Erick Archer, Pali Rohár

> Add error handling to propagate alps_passthrough_mode_v2() failures
> to the caller. When alps_passthrough_mode_v2() fails, immediately
> return -1 to stop further processing and maintain consistent error
> reporting.

How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.14-rc5#n145

Regards,
Markus

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-03-07 17:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-03 11:07 [PATCH] Input: alps - Propagate alps_passthrough_mode_v2() errors in alps_poll() Wentao Liang
2025-03-07 17:54 ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).