Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1721488lqb; Sun, 26 May 2024 14:19:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVoOWxKCteB156ueNVxDTjiuzFvKgAsL1GWlxQx8B9BQCSnK6Pjt9RfO1pDXaFRexX8gP2/Xf6kxxJdGt8++3SBEP0xIZG6jTjkgouHjQ== X-Google-Smtp-Source: AGHT+IEvTVGFKXeSjW3orqRpLza67fWR6CfDWWa4/B7NEocBLdVKou1wftK0OEshgVqGluoBiVca X-Received: by 2002:a92:c247:0:b0:36a:3f20:8cb with SMTP id e9e14a558f8ab-3737b32912fmr80269085ab.18.1716758357188; Sun, 26 May 2024 14:19:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716758357; cv=pass; d=google.com; s=arc-20160816; b=qvOTvZ8TdA20LuF6RZOeso5n/jv9ODEW5Tg6mG7WotejJmqLR291EBk2KHQ6FwPKYT rxKBp//Dh0zsSIXiIvlUOeTrLl6rH8Lyk0zadakk3tPjkh1zkKSfK+BXJaa3k7/uiJiw 64dM1RJDeFBKapSBKCtBGbK9wRLBVE8muh2ATLRTUVNqrRhgQ+/RYObB5zlDyRlYJaSE 31YGEvwV4Fjo/Endh6LBxaTv9ES2FqL4N+f5nX4UTYjktzZZmG0d1US91X8iK/lJjD0L KJ+PSyhd1tX6A5IU7Is11JKPytftlf8Sp1YvecTW8SWROisPTkKuRkUTFcHev/JIZORN gSGQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=OEIFM+ukt26ot774C0FBgnpAZ7Ab3pUhoDY2KfgwdKw=; fh=77SyfQZj0Z9C/j5D/i2obb0nzx85cjWR1kT0BRfBqbA=; b=jgUj2rdZ7WxGMd2ZhlxFxEVeAZ/ZVCDqjWlgBfu9ZDSBXCRcoTy3EezSZU68y6ocNq A1hzkCaGYkXXK/u3EPGuHauOJ1vMq4s2ButEHsmZh5jveYPZHDZl/AUE6bN7uDkph1yi gf43JWS4tcXp7LZM0NId9ToKq/LozaqtsBlAAhF9HdBx7TfYQh+1z2xjS4cz2sAQ7J7n Dzd96KyIg0YAeKNvybjRLqjd+yxq/2EXqO4tftFyk8bdb8sOUY9I4kiX31fLywlfZKLq HEgl9aCW11crAaxdQdsKmmI0UowUxulMkhF9JfRl+uO5i2pRT61FZyiO8zFPdC9UxnAS PdJA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E7jt2jSa; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-189874-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189874-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-68222db0020si3190331a12.185.2024.05.26.14.19.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 May 2024 14:19:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-189874-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E7jt2jSa; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-189874-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189874-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 48F4E281225 for ; Sun, 26 May 2024 21:19:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B5A7C139D01; Sun, 26 May 2024 21:19:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="E7jt2jSa" Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E91D2F46 for ; Sun, 26 May 2024 21:19:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716758351; cv=none; b=e8E3vF90fAC4EKnHZeh0yy/n3za8Lg2W6wAnGSL9aymT8XOHa41Gq+iQkRDmwcCVlfamW7+ZpuXIdHYsQqWYltLlRF59aKAeerMpddqofqBATVKv+j27cNySAjyzBvE+tijS21tZHu2oRdTwhMBWNcMjocqq2iXfHd6h7UZH6Tc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716758351; c=relaxed/simple; bh=Pn8FslhbcHCMf78r21xAL7hMjz7SqSvFvE3Vdll6SFI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LBtAvyMfB2BvszAvWJ+4ykMKKvRyAOEodaVv/rNTmEn8hUH1I1Lhgl8jkVO7J7il3kKfWe5rkm8Fpn/d8V+3eY0OeW6STYgcnOZVxmm+f8OYk2PS3xUvEVMxc3gvyHx5UgXWHoFY+dDbkk26zWmT1wsggYYgPUOUywwssQWFZPo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=E7jt2jSa; arc=none smtp.client-ip=209.85.208.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2e72224c395so83137771fa.3 for ; Sun, 26 May 2024 14:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716758348; x=1717363148; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=OEIFM+ukt26ot774C0FBgnpAZ7Ab3pUhoDY2KfgwdKw=; b=E7jt2jSabwkEocc9SDeyqYkTOoCDSNIonyrSui7KLjFNKSzgVCGl5UQOIejDWXNgeU v737TomtRjG/+5MXW9hgNudUt3dtUz8QsfHL4xF3Hz3IjB3uK8P6WUTUpBKSyh5r4EJ2 yJttPfF3Hi86kY432Ci9GhMWK+neAXk8j2CiiuouED0tO51yt01OBEjfAznA6nVJZXO6 zPtjuNLV1Aux0cbB/uVBUQjAy9DCI6/KAYE70oSPKOJKSbideFp1mgEmdBmePDf9tqbn M2AvI7LsylE6KC2xkEV0fzsHRjaIEZyDl04AyOynL2u2JVwSWP35MhndVUb+iMKKWD9i RnIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716758348; x=1717363148; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OEIFM+ukt26ot774C0FBgnpAZ7Ab3pUhoDY2KfgwdKw=; b=NRR5J40tWUZkvnPV8/Zid0W1hUtTBME6zDZxhxKglR1E4zUSiPikeaxnFRcSDsON4t p+HwouShk6J02vodUgvG8hlMqiEWRttlAF6UOqvtTPBayIRgKCIg0ODJRWpcVs9hA0A6 ZYVIVWohxdMJHkT44dcTi8DqI7YOe6MhT4ooMyU7+fxJ1/oryA1H9fhbWTVgZOTpnbGK S8qvGI21mZW0y4hNKIEdrlx8UUah8fusWHVtxms6BCWenmRoqml1qAcLsHKcYncR4/ag 6T/PZ1iaRwHFSnqxzawAGdLdfUExGP0E8HzJVnwT964QyPUFBMsFqa5xlR5J/rlH8oqe JvXQ== X-Forwarded-Encrypted: i=1; AJvYcCVV51AyObiH5e4c+Wf1L7hW6314F3zM7iX1NKtJY/CrxHN8Rl+IleCxQJCKC7daSIkRKujQIMVYNvcT5DtBA23XT5oCPp2B7zm5AU3E X-Gm-Message-State: AOJu0YyThuk1/uX/Fy/XqCSa8NQWPZPcm1NPr0D22o+4Rr6vyVH43OVC /2jvLwuyQgtBEUP/++61bY/25t2dr5fzehtWHJAUgykWNC+k+bipuPQzug853d8= X-Received: by 2002:a2e:2e10:0:b0:2e5:87c1:e845 with SMTP id 38308e7fff4ca-2e95b278a70mr44542691fa.48.1716758348145; Sun, 26 May 2024 14:19:08 -0700 (PDT) Received: from eriador.lumag.spb.ru (dzdbxzyyyyyyyyyyyykxt-3.rev.dnainternet.fi. [2001:14ba:a0c3:3a00::227]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2e95bcf47dasm15796671fa.55.2024.05.26.14.19.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 May 2024 14:19:07 -0700 (PDT) Date: Mon, 27 May 2024 00:19:06 +0300 From: Dmitry Baryshkov To: Sui Jingfeng Cc: Robert Foss , Laurent Pinchart , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 02/10] drm/bridge: Set firmware node of drm_bridge instances automatically Message-ID: References: <20240526202115.129049-1-sui.jingfeng@linux.dev> <20240526202115.129049-3-sui.jingfeng@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240526202115.129049-3-sui.jingfeng@linux.dev> 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. -- With best wishes Dmitry