From 81022a170462d38ea10612cb67e8e2c529d58abe Mon Sep 17 00:00:00 2001
From: Miaoqian Lin <linmq006@gmail.com>
Date: Sun, 17 Apr 2022 13:03:31 -0700
Subject: [PATCH] Input: omap4-keypad - fix pm_runtime_get_sync() error
checking
Git-commit: 81022a170462d38ea10612cb67e8e2c529d58abe
References: git-fixes
Patch-mainline: v5.18-rc4
If the device is already in a runtime PM enabled state
pm_runtime_get_sync() will return 1, so a test for negative
value should be used to check for errors.
Fixes: f77621cc640a ("Input: omap-keypad - dynamically handle register offsets")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220412070131.19848-1-linmq006@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
drivers/input/keyboard/omap4-keypad.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -317,7 +317,7 @@ static int omap4_keypad_probe(struct pla
* revision register.
*/
error = pm_runtime_get_sync(&pdev->dev);
- if (error) {
+ if (error < 0) {
dev_err(&pdev->dev, "pm_runtime_get_sync() failed\n");
pm_runtime_put_noidle(&pdev->dev);
} else {