linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/vc4: Fix pm_runtime_get_sync() error checking
@ 2022-04-12  7:04 Miaoqian Lin
  2022-04-19 12:44 ` Maxime Ripard
  0 siblings, 1 reply; 8+ messages in thread
From: Miaoqian Lin @ 2022-04-12  7:04 UTC (permalink / raw)
  To: Emma Anholt, Maxime Ripard, David Airlie, Daniel Vetter,
	Eric Anholt, dri-devel, linux-kernel
  Cc: linmq006

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: 4078f5757144 ("drm/vc4: Add DSI driver")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/gpu/drm/vc4/vc4_dsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
index 752f921735c6..26aa7d1fa421 100644
--- a/drivers/gpu/drm/vc4/vc4_dsi.c
+++ b/drivers/gpu/drm/vc4/vc4_dsi.c
@@ -847,7 +847,7 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)
 	int ret;
 
 	ret = pm_runtime_get_sync(dev);
-	if (ret) {
+	if (ret < 0) {
 		DRM_ERROR("Failed to runtime PM enable on DSI%d\n", dsi->variant->port);
 		return;
 	}
-- 
2.17.1


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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12  7:04 [PATCH] drm/vc4: Fix pm_runtime_get_sync() error checking Miaoqian Lin
2022-04-19 12:44 ` Maxime Ripard
2022-04-20  0:49   ` [PATCH v2] drm/vc4: Fix pm_runtime_get_sync() usage Miaoqian Lin
2022-04-20  7:51     ` Maxime Ripard
2022-04-20  8:05       ` Miaoqian Lin
2022-04-20 13:28         ` Maxime Ripard
2022-04-20 13:50           ` [PATCH v3] drm/vc4: Use pm_runtime_resume_and_get to fix " Miaoqian Lin
2022-04-21  7:17             ` (subset) " Maxime Ripard

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