Skip to contentSkip to conversation

Input: omap4-keypad - Fix pm_runtime_get_sync() error checking

PATCH Applied Miaoqian Lin 2 participants 2 messages Apr 12, 2022 – Apr 17, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: omap4-keypad - Fix pm_runtime_get_sync() error checking

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")
---
 drivers/input/keyboard/omap4-keypad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/omap4-keypad.c +1 -1
index 43375b38ee59..8a7ce41b8c56 100644
@@ -393,7 +393,7 @@ static int omap4_keypad_probe(struct platform_device *pdev)
 	 * revision register.
 	 */
 	error = pm_runtime_get_sync(dev);
-	if (error) {
+	if (error < 0) {
 		dev_err(dev, "pm_runtime_get_sync() failed\n");
 		pm_runtime_put_noidle(dev);
 		return error;
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 6 lines · Miaoqian Lin

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")

Applied, thank you.

Signature · 1 line
Dmitry