All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob ynn <yanlonglong@kylinos.cn>
To: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org, Andy Yan <andy.yan@rock-chips.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>,
	Laurent Pinchart <laurent.pinchart@idesanoboard.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Luca Ceresoli <luca.ceresoli@bootlin.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>,
	Simona Vetter <simona.vetter@ffwll.ch>,
	yanlonglong <yanlonglong@kylinos.cn>
Subject: [PATCH] drm/bridge: synopsys: dw-dp: fix bool function returning negative error code
Date: Fri, 15 May 2026 10:01:55 +0800	[thread overview]
Message-ID: <20260515020156.601-1-yanlonglong@kylinos.cn> (raw)

From: yanlonglong <yanlonglong@kylinos.cn>

The function dw_dp_video_need_vsc_sdp() is declared to return bool, but
it returns -EINVAL when dw_dp_get_bridge_state() fails. Since -EINVAL is
a non-zero value (-22), it is implicitly converted to true, which is the
opposite of the intended behavior

Fixes: 86eecc3a9c2e("drm/bridge: synopsys: Add DW DPTX Controller support library")
Signed-off-by: yanlonglong <yanlonglong@kylinos.cn>
---
 drivers/gpu/drm/bridge/synopsys/dw-dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-dp.c b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
index 21541be094c4..7b99d91b3456 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-dp.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
@@ -1143,7 +1143,7 @@ static bool dw_dp_video_need_vsc_sdp(struct dw_dp *dp)
 
 	state = dw_dp_get_bridge_state(dp);
 	if (!state)
-		return -EINVAL;
+		return false;
 
 	if (!link->vsc_sdp_supported)
 		return false;
-- 
2.43.0


             reply	other threads:[~2026-05-15  2:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-15  2:01 Bob ynn [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-05-11  6:39 [PATCH] drm/bridge: synopsys: dw-dp: fix bool function returning negative error code Bob ynn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260515020156.601-1-yanlonglong@kylinos.cn \
    --to=yanlonglong@kylinos.cn \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=andy.yan@rock-chips.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=laurent.pinchart@idesanoboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=simona.vetter@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.