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 5D32BC25B75 for ; Mon, 27 May 2024 02:01:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 07A6B10F79B; Mon, 27 May 2024 02:01:51 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=linux.dev header.i=@linux.dev header.b="aI1YAsuy"; dkim-atps=neutral Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) by gabe.freedesktop.org (Postfix) with ESMTPS id 68E3B10F79B for ; Mon, 27 May 2024 02:01:47 +0000 (UTC) X-Envelope-To: dmitry.baryshkov@linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1716775304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C4KbC23pVUx2ZjByBYlN7VlAIPsbM3xhWrQdhcgUorw=; b=aI1YAsuyn35SzhLYiWlpO+d5nNexjamENbPmTyQSbuBnXV4YNy/F9IQ3Sh1BPtVMC5VAtv dhCQQx1ME086s38TXjxcZDILTzAdK8+2w25Bss+qnOaR1m3Po54Et78J9AI1DWM09UQ9Z1 DQhvk+bhFzFdb+ySSykqQKW0B9+bOzo= X-Envelope-To: rfoss@kernel.org X-Envelope-To: laurent.pinchart@ideasonboard.com X-Envelope-To: dri-devel@lists.freedesktop.org X-Envelope-To: linux-kernel@vger.kernel.org Message-ID: <03701609-86b7-47a3-85af-db47035695fb@linux.dev> Date: Mon, 27 May 2024 10:01:35 +0800 MIME-Version: 1.0 Subject: Re: [PATCH v6 02/10] drm/bridge: Set firmware node of drm_bridge instances automatically To: Dmitry Baryshkov Cc: Robert Foss , Laurent Pinchart , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20240526202115.129049-1-sui.jingfeng@linux.dev> <20240526202115.129049-3-sui.jingfeng@linux.dev> Content-Language: en-US, en-AU X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Sui Jingfeng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT 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, On 5/27/24 05:19, Dmitry Baryshkov wrote: > On Mon, May 27, 2024 at 04:21:07AM +0800, Sui Jingfeng wrote: >> Normally, the drm_bridge::of_node won't be used by bridge driver instances >> themselves. Rather, it is mainly used by other modules to find associated >> drm bridge drvier. Therefore, adding a drm bridge to the global bridge list >> and setting 'of_node' field of a drm bridge share the same goal. Both are >> for finding purpose, therefore better to group them to one function. >> >> Update the drm_bridge_add() interface and implementation to achieve such >> goal atomically, new implementation will fetch the device node from the >> backing device of the drm bridge driver automatically. For the majority >> cases, which is one device backing one drm bridge driver, this model works >> well. Drivers still can set it manually by passing NULL if this model >> doesn't fit. >> >> While at it, Add a 'struct device *' pointer to the drm_bridge structure. >> As it already being passed in by both of drm_bridge_add() and >> devm_drm_bridge_add(). A lot of driver instances has already added it into >> their derived structure, promote it into drm_bridge core helps to reduce >> a batch of boilerplates. >> >> Signed-off-by: Sui Jingfeng >> --- > > [trimmed] > >> @@ -231,7 +243,7 @@ static void drm_bridge_remove_void(void *bridge) >> */ >> int devm_drm_bridge_add(struct device *dev, struct drm_bridge *bridge) >> { >> - drm_bridge_add(bridge); >> + drm_bridge_add(bridge, dev); >> return devm_add_action_or_reset(dev, drm_bridge_remove_void, bridge); > > This breaks aux-hpd-bridge, which gets of_node as an external pointer > rather than dev->of_node. > Yes, you are right. I forget to modify that driver. My bad, will be fixed at the next version. -- Best regards Sui