From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6C74310F9961 for ; Wed, 8 Apr 2026 17:39:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C95A210E149; Wed, 8 Apr 2026 17:39:14 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="JuriSJgw"; dkim-atps=neutral Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 16B2810E149 for ; Wed, 8 Apr 2026 17:39:12 +0000 (UTC) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id B19CE1A3209; Wed, 8 Apr 2026 17:39:11 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 6EEE6603CE; Wed, 8 Apr 2026 17:39:11 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id F0E60104500F3; Wed, 8 Apr 2026 19:39:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775669950; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=o1r78Oe7IhroDVFua4r3F62SWxavC2jpM81v5Mz3foQ=; b=JuriSJgw9+8ml1Ogw2VVzBdYD2DmSJIGpR4sQs5SbqIAJTjKGCJhxw6uOoEhQXtN+Bz4l5 N+cizsNqX4Div0NMZPHQYwPbGdkHUj90rtPc6poxq7/Z6519e7hDBPzii/4mSFyyga1x8Y KfBfE5R9S52FLbiJIypjTjiOljb6S/SMvhOrMcdua7qfzK7LNtyA13LnOBIxCmeQfMLynY moVbo2sSvGrsuhNs9LhAU9G4PbI1ZP/nwYXpNQDfLc/gFzxUcLcY/0h7vCVh+L5O+tVRjp g5xDgxfWGtPyGQOu2I2VI69EXsprVy0Oqk+502RRH6VpRUkcDVk5jsQoWi4fag== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 08 Apr 2026 19:39:03 +0200 Message-Id: Subject: Re: [PATCH v4 1/4] drm: renesas: rz-du: rzg2l_du_encoder: convert to of_drm_find_and_get_bridge() Cc: "Hui Pu" , "Ian Ray" , "Thomas Petazzoni" , , , To: "Louis Chauvet" , "Biju Das" , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "David Airlie" , "Simona Vetter" , "Anitha Chrisanthus" , "Linus Walleij" , "Laurent Pinchart" , "Tomi Valkeinen" , "Kieran Bingham" , "Geert Uytterhoeven" , "Magnus Damm" , "Tomi Valkeinen" From: "Luca Ceresoli" X-Mailer: aerc 0.20.1 References: <20260402-drm-bridge-alloc-getput-drm_of_find_bridge-4-v4-0-421781c8c061@bootlin.com> <20260402-drm-bridge-alloc-getput-drm_of_find_bridge-4-v4-1-421781c8c061@bootlin.com> In-Reply-To: X-Last-TLS-Session-Version: TLSv1.3 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Louis, On Wed Apr 8, 2026 at 5:44 PM CEST, Louis Chauvet wrote: >> @@ -83,10 +83,21 @@ int rzg2l_du_encoder_init(struct rzg2l_du_device *r= cdu, >> >> bridge =3D devm_drm_panel_bridge_add_typed(rcdu->dev, panel, >> DRM_MODE_CONNECTOR_DPI); >> - if (IS_ERR(bridge)) >> - return PTR_ERR(bridge); >> + if (IS_ERR(bridge)) { >> + // Inhibit the cleanup action on an ERR_PTR >> + ret =3D PTR_ERR(bridge); >> + bridge =3D NULL; >> + return ret; >> + } > > Can't you use > https://elixir.bootlin.com/linux/v6.19.11/source/include/linux/cleanup.h#= L230? > > return PTR_ERR(no_free_ptr(bridge)); Ah, nice cleanup indeed! However, being this patch already reviewed ans tested, I'll postpone this cleanup to a later series. > With or without this modification: > > Reviewed-by: Louis Chauvet Thanks! Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com