[SRU][OEM-OSP1-B][PATCH 1/2] Revert "UBUNTU: SAUCE: Input: i8042 - Fix the selftest retry logic"

You-Sheng Yang vicamo.yang at canonical.com
Mon Mar 16 09:27:46 UTC 2020


BugLink: https://bugs.launchpad.net/bugs/1866734

This reverts commit 0aa61f18ea08137125fc7453b48526371184699e.

Signed-off-by: You-Sheng Yang <vicamo.yang at canonical.com>
---
 drivers/input/serio/i8042.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index c64f43ebe56a..1e29408491eb 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -937,9 +937,10 @@ static int i8042_controller_selftest(void)
 	 */
 	do {
 
-		if (i8042_command(&param, I8042_CMD_CTL_TEST))
-			pr_info("i8042 controller selftest timeout (%d/5)\n",
-			        i+1);
+		if (i8042_command(&param, I8042_CMD_CTL_TEST)) {
+			pr_info("i8042 controller selftest timeout\n");
+			return -ENODEV;
+		}
 
 		if (param == I8042_RET_CTL_TEST)
 			return 0;
@@ -947,9 +948,7 @@ static int i8042_controller_selftest(void)
 		dbg("i8042 controller selftest: %#x != %#x\n",
 		    param, I8042_RET_CTL_TEST);
 		msleep(50);
-	} while (++i < 5);
-	if (i == 5)
-		return -ENODEV;
+	} while (i++ < 5);
 
 #ifdef CONFIG_X86
 	/*
-- 
2.25.1




More information about the kernel-team mailing list