linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: omap4-keypad - Fix pm_runtime_get_sync() error checking
@ 2022-04-12  7:01 Miaoqian Lin
  2022-04-17 20:04 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Miaoqian Lin @ 2022-04-12  7:01 UTC (permalink / raw)
  To: Dmitry Torokhov, Miaoqian Lin, G, Manjunath Kondaiah,
	Felipe Balbi, Poddar, Sourav, linux-input, linux-kernel

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>
---
 drivers/input/keyboard/omap4-keypad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
index 43375b38ee59..8a7ce41b8c56 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -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;
-- 
2.17.1


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

* Re: [PATCH] Input: omap4-keypad - Fix pm_runtime_get_sync() error checking
  2022-04-12  7:01 [PATCH] Input: omap4-keypad - Fix pm_runtime_get_sync() error checking Miaoqian Lin
@ 2022-04-17 20:04 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2022-04-17 20:04 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: G, Manjunath Kondaiah, Felipe Balbi, Poddar, Sourav, linux-input,
	linux-kernel

On Tue, Apr 12, 2022 at 07:01:26AM +0000, Miaoqian Lin wrote:
> 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>

Applied, thank you.

-- 
Dmitry

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

end of thread, other threads:[~2022-04-17 20:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12  7:01 [PATCH] Input: omap4-keypad - Fix pm_runtime_get_sync() error checking Miaoqian Lin
2022-04-17 20:04 ` Dmitry Torokhov

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