From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 D9BF9377575; Mon, 4 May 2026 14:13:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777904029; cv=none; b=XFhGS/B0cDBUR+FoKMRVG8EAn3K+UnOYWO/ktnxIpCBewJ2bCNEF4PO09GTJPsrg9UuEZaEpYox+d5kLcIDopX9psEcvKFSCs/KBsCjhgE7RdoJ3CjKY+LAOXEsSavdWnSRFxJpK8rHVZEEbiNPO9Z54z5sU5liB0PsV4N3rxqs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777904029; c=relaxed/simple; bh=XsNmFR8dV4OacjfIioHdUGNm4L3AowKlSDqo2yTRzw8=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=jfvoSYq6qIzzta5UPoR74Wdqa4v+0X5Jj32yx4Jel6tAM1GOe5937dfJZiWJCqk1TPaXQz7zqDKax4EAb8ZuuREugKbCypvjGq6icqJQAdO6cTNPieQZPnuvY/82Zap8YefnwEgrWcWPJ2+LT04jc/ANfGWs6Jf0059iw27QxVw= 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=AFI5Mvlr; arc=none smtp.client-ip=185.171.202.116 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="AFI5Mvlr" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 94D59C5D72D; Mon, 4 May 2026 14:14:31 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 21DC25FD5F; Mon, 4 May 2026 14:13:45 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id CCCB711AD27FB; Mon, 4 May 2026 16:13:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1777904023; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=XsNmFR8dV4OacjfIioHdUGNm4L3AowKlSDqo2yTRzw8=; b=AFI5Mvlro/TMbUmDqfw6uuasM2l3dZYYZR9gYoQkon/fLCo3EvKUyNNFBC/QEdh3UsgPE0 /7gYVYkc5TduLQZWOs7RLRZ8VBl/TUyIcFZNHzxezTrcn2J+YwTOpSLRnb/wM0M3ZcLrA9 Lm2FueyC8nmzxUe1s1qWG5sbz1DvWaN/1LQ7cnLW6F7HbhXvVu6z9wO+ubYbEuQbNtRSvN LlAwzXp9TH/yhof4kNc4NJV2lcb8NApSHflSLMIdoi7+ItBAfw3SgF93mrkGrU99tsASNf dediVg4WLdgI85RyfhTmH6WWXJoKbLBbhcyb2krC+3W2W/beCnk+piqeWLU5YQ== 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: Mon, 04 May 2026 16:13:32 +0200 Message-Id: Subject: Re: [PATCH v4 01/11] drm/bridge: drm_bridge_get/put(): ignore ERR_PTR Cc: "Andrzej Hajda" , "Neil Armstrong" , "Robert Foss" , "Jonas Karlman" , "Jernej Skrabec" , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "David Airlie" , "Simona Vetter" , "Rob Clark" , "Dmitry Baryshkov" , "Abhinav Kumar" , "Jessica Zhang" , "Sean Paul" , "Marijn Suijten" , "Sumit Semwal" , "John Stultz" , "Tomi Valkeinen" , "Michal Simek" , "Hui Pu" , "Ian Ray" , "Thomas Petazzoni" , , , , , , "Dmitry Baryshkov" To: "Laurent Pinchart" From: "Luca Ceresoli" X-Mailer: aerc 0.20.1 References: <20260504-drm-bridge-alloc-getput-panel_or_bridge-v4-0-b578c3daaf10@bootlin.com> <20260504-drm-bridge-alloc-getput-panel_or_bridge-v4-1-b578c3daaf10@bootlin.com> <20260504135300.GE1344263@killaraus.ideasonboard.com> In-Reply-To: <20260504135300.GE1344263@killaraus.ideasonboard.com> X-Last-TLS-Session-Version: TLSv1.3 Hi Laurent, On Mon May 4, 2026 at 3:53 PM CEST, Laurent Pinchart wrote: > On Mon, May 04, 2026 at 12:45:04PM +0200, Luca Ceresoli wrote: >> Most functions returning a struct drm_bridge pointer currently return a >> valid pointer or NULL, but this restricts their ability to return an err= or >> code describing the error kind. >> >> In preparation to have new APIs that can return a struct drm_bridge poin= ter >> holding an ERR_PTR (and for those which already do) make drm_bridge_get(= ) >> and drm_bridge_put() ignore ERR_PTR values, just like they ignore NULL >> pointers. > > The change in drm_bridge_put() looks good to me. I'm less sure about > drm_bridge_get(), is there a valid use case to call get() on a bridge > that is not valid ? Doesn't it indicate a clear error in the caller ? Good point. Indeed I don't have a valid use case in mind. I guess I can drop the drm_bridge_get() and send v5. Should there be a valid use case it will emerge at some point and this can be rediscussed. Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com