From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 041822F5308 for ; Thu, 5 Feb 2026 09:06:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770282381; cv=none; b=PRZbxi0L1DSwpwMpOdjOAmcUGfh/tqUjie1EaT/TNs2TMYDjlPaczPUQK9Rz0U8sJ5Rage01p1HD++oOJMO/cAX63QxvMV4u4zzBwWQfT24qhJx0d1FZYhAGobXfSWZit+NU0RVkhrqgHuU0O9Nx91TTn+xRLzJmdUdZM7A5HZQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770282381; c=relaxed/simple; bh=hUV04pavrkJHr9ArEDvZB4NuFF6OKcq/GwCP5in9/Dc=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=CGFjtHSk97br3/kGwihM+TObFhogYGlw0qHlSQF65jQOeVH/TqW4F+HrTHgBEc3yAGlM6jL4e5HHBdpTvvYO7+jZ3fkPwVA+q8RkVTJ130LSF3m0IJy0FlPmF+58BJRzM3RNxg1mXcELoUDeVxuSaU3d7Lgl/zD6cBF6zxlYjwI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=YeNJCCda; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="YeNJCCda" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 713234E4240E; Thu, 5 Feb 2026 09:06:19 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 43C79606FD; Thu, 5 Feb 2026 09:06:19 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 88A95119A88EE; Thu, 5 Feb 2026 10:06:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1770282378; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=EZW9RspXiOG1EsA4BrKT08TjY+AaRCXLFfK0GdRkHMM=; b=YeNJCCdaqFDQvB4UzlGTPuaV0Dig3NDBJzC7W4EkABm1898rR0xMFDMUgTR4pKgsKNN8cQ JpZfGfb9qqzBhNDd01h6flq7pTp5C7dOnvPRuyfOupekQ7KQEESoGRA+0wdYqu4JEK+PTT jyY2H/bkZe1OC+7HdCufQwyRaN7Bxkv/mqb5whz34Vj8dHSIxJWaPlTHG4DIChTImP+RWC 7a3Y4BQEIScN+65a7ipOuykLajiWgixH00HU3AEs2YKD7nPOOfamx/xTLJDBU/Z6xBoeOE VndDslq3huFSsrBe5croU3ejQIPUgbeQcF/hpI5C1un4qDhVHM37lxL062tDcA== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 05 Feb 2026 10:06:09 +0100 Message-Id: Subject: Re: [PATCH v2] drm/bridge: synopsys: dw-dp: Check return value of devm_drm_bridge_add() in dw_dp_bind() Cc: , To: "Chen Ni" , , , , , , , , , , , , , , From: "Luca Ceresoli" X-Mailer: aerc 0.20.1 References: <3384b794.65bd.19c27b7d739.Coremail.andyshrk@163.com> <20260204092148.2309681-1-nichen@iscas.ac.cn> In-Reply-To: <20260204092148.2309681-1-nichen@iscas.ac.cn> X-Last-TLS-Session-Version: TLSv1.3 On Wed Feb 4, 2026 at 10:21 AM CET, Chen Ni 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 atta= ching") > Signed-off-by: Chen Ni Ah, good catch, thanks for the patch! > --- > Changes in v2: > - Use ERR_PTR() instead of dev_err_ptr_probe(). > --- > drivers/gpu/drm/bridge/synopsys/dw-dp.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-dp.c b/drivers/gpu/drm/br= idge/synopsys/dw-dp.c > index 432342452484..29fcba7a47d3 100644 > --- a/drivers/gpu/drm/bridge/synopsys/dw-dp.c > +++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c > @@ -2049,7 +2049,11 @@ struct dw_dp *dw_dp_bind(struct device *dev, struc= t drm_encoder *encoder, > bridge->type =3D DRM_MODE_CONNECTOR_DisplayPort; > bridge->ycbcr_420_allowed =3D true; > > - devm_drm_bridge_add(dev, bridge); > + ret =3D devm_drm_bridge_add(dev, bridge); > + if (ret) { > + dev_err_probe(dev, ret, "failed to add bridge\n"); > + return ERR_PTR(ret); > + } Looks correct, but can be simpler: ret =3D devm_drm_bridge_add(dev, bridge); if (ret) return ERR_PTR(dev_err_probe(dev, ret, "failed to add bridge\n")); Also, when sending a new iteration, it is common to _not_ send the patch as a reply to the previous iteration. It can generate huge threads for long series. Also I'd not be surprised if it confused some tools, even though I just did a quick test with b4 and it seems to do the expected thing (take v2, not v1). Best regards, Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com