mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Andy Yan" <andyshrk@163.com>
To: "Chen Ni" <nichen@iscas.ac.cn>
Cc: andy.yan@rock-chips.com, andrzej.hajda@intel.com,
	neil.armstrong@linaro.org, rfoss@kernel.org,
	Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se,
	jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com,
	mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
	simona@ffwll.ch, rgallaispou@gmail.com,
	luca.ceresoli@bootlin.com, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re:[PATCH] drm/bridge: synopsys: dw-dp: Check return value of devm_drm_bridge_add() in dw_dp_bind()
Date: Wed, 4 Feb 2026 16:14:45 +0800 (CST)	[thread overview]
Message-ID: <3384b794.65bd.19c27b7d739.Coremail.andyshrk@163.com> (raw)
In-Reply-To: <20260204075319.1994814-1-nichen@iscas.ac.cn>









Hello,
At 2026-02-04 15:53:19, "Chen Ni" <nichen@iscas.ac.cn> wrote:
>Return the value of devm_drm_bridge_add() in order to propagate the
>error properly, if it fails due to resource allocation failure or bridge
>registration failure.
>
>This ensures that the bind function fails safely rather than proceeding
>with a potentially incomplete bridge setup.
>
>Fixes: b726970486d8 ("drm/bridge: synopsys: dw-dp: add bridge before attaching")
>Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
>---
> drivers/gpu/drm/bridge/synopsys/dw-dp.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/gpu/drm/bridge/synopsys/dw-dp.c b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
>index 432342452484..b0007805f283 100644
>--- a/drivers/gpu/drm/bridge/synopsys/dw-dp.c
>+++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
>@@ -2049,7 +2049,9 @@ struct dw_dp *dw_dp_bind(struct device *dev, struct drm_encoder *encoder,
> 	bridge->type = DRM_MODE_CONNECTOR_DisplayPort;
> 	bridge->ycbcr_420_allowed = true;
> 
>-	devm_drm_bridge_add(dev, bridge);
>+	ret = devm_drm_bridge_add(dev, bridge);
>+	if (ret)

>+		return dev_err_ptr_probe(dev, ret, "Failed to add bridge\n");


          The return value of this funciont is struct dw_dp*, so you should return  ERR_PTR(ret) here.> 


> 	dp->aux.dev = dev;
> 	dp->aux.drm_dev = encoder->dev;
>-- 
>2.25.1

  reply	other threads:[~2026-02-04  8:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-04  7:53 [PATCH] " Chen Ni
2026-02-04  8:14 ` Andy Yan [this message]
2026-02-04  9:21   ` [PATCH v2] " Chen Ni
2026-02-04  9:42     ` Andy Yan
2026-02-05  9:06     ` [PATCH " Luca Ceresoli
2026-02-05  9:21       ` Luca Ceresoli

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=3384b794.65bd.19c27b7d739.Coremail.andyshrk@163.com \
    --to=andyshrk@163.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --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=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=nichen@iscas.ac.cn \
    --cc=rfoss@kernel.org \
    --cc=rgallaispou@gmail.com \
    --cc=simona@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®