]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Input: omap4-keypad - fix pm_runtime_get_sync() error checking
authorMiaoqian Lin <linmq006@gmail.com>
Sun, 17 Apr 2022 20:03:31 +0000 (13:03 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sun, 17 Apr 2022 20:13:34 +0000 (13:13 -0700)
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: 66e061a498b9 ("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>
drivers/input/keyboard/omap4-keypad.c

index 43375b38ee5926f31a653dfe1efb801b927332b3..8a7ce41b8c56e1b62bd8e8fe4f51204ca55c54c8 100644 (file)
@@ -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;