Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1908674lqm; Fri, 3 May 2024 09:42:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWJqV241nrHPAaqNmsYTspj6PSt0Ln/Zw7rQLNbDxXjbNMCrGfNtp0CAekEH73UqlBVjaRltDYYnCSY9JI1jUMWaRAI7NyQFx/4rFaf4w== X-Google-Smtp-Source: AGHT+IH0l84CsZfc6CROtXAO2G91/quqmEtc95pvar8Mlqk4IE7XXHW7tlrmZOL+uyEyBaIsXh5e X-Received: by 2002:a05:620a:280b:b0:790:b14b:21b9 with SMTP id f11-20020a05620a280b00b00790b14b21b9mr9534159qkp.18.1714754527975; Fri, 03 May 2024 09:42:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714754527; cv=pass; d=google.com; s=arc-20160816; b=1Govb5TjEdE9Xp/YaleAQzacimf2LeZhwMPbIr8zMlvISSHs07T8OPUcVVmpKWeSac 73hIeXGiRP8uola/oHPuE+tH5OVhbl99sTHA3niSER/R/byiRPtahfAhmObIZbFJG5D9 Aj4CBJoI0LRJK97gX9pG3ko/WUA4tEi2/JyX162bnkwOgeztKgz4saeeEZm1JdT5JpEZ U7Iyo43tdTz+MwhQwcTBGRHCjOAaocX7psQceFFXT+w93IVX/8XYWCYYDs/vLRlQ9qjh hoi9o47a1jVCBYcVwZyyELh9wrheKdf8VcvDcWJDGrSSsS7mfNlda5inw01FqUBrQJyF 2TNw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=vO5DAzgmog7KilXxDbcqZljq54cRteB1aUJEF70aaEA=; fh=J0u8x3s/k023UEbLK71VgPzFqSxU+SDe+x9YLxjtY3g=; b=MB0/iG5CWhuKYxfn7lOE+EsqTB92tsIxPDngzcy/8dpikKFgQPdZLcEopVdXJkzF3W 5HLw6n2EHvN3WX3ZButFOYFbIjZmAuvyGf6o5pxqCgi2bQZVHO+qcOEi+Qzs0vptNRCs g8/8XBLyLp4sFPHAKs2TtfskLdlAQrjBC4NcHEWVOdrV4D1H0NDVMaAKlHnEPSRIXlz8 a9hGHfS87wP9MPcAvNi/UErodYvQQvbxZTP9qGOAJK+mXY2G51WrVPZuZwopOLr78LAr DTNTOxEkLlgYv6jJ7wDrO0m9bJKIRySWXuRg7zyLzJjIZPGrp0kBEfqXxvZeB2i9Odca GQvQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ID1+odDF; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-167916-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167916-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id t10-20020a05620a450a00b00790db0e8aafsi4034781qkp.130.2024.05.03.09.42.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 09:42:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167916-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ID1+odDF; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-167916-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167916-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6B6E81C21A7A for ; Fri, 3 May 2024 16:42:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C45D415688A; Fri, 3 May 2024 16:41:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ID1+odDF" Received: from out-189.mta1.migadu.com (out-189.mta1.migadu.com [95.215.58.189]) (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 69E07156986 for ; Fri, 3 May 2024 16:41:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714754492; cv=none; b=lmkqjhQ+52+e9iELz4s34zD2HLqD0HH4vfRUv48mQvukQr5RGJhQfCAVONkO0aMRHCyi8TVDCAWnIGr1JoNH/ktQL5q+cu1IpI0SuthRYCWV+UG6+8xhoDidsiKqgoYlhhrGTN8iakC71XfQ0XIDM/dirICRjrwUjLqAeRSXSV4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714754492; c=relaxed/simple; bh=QkMsAUThQKPw2KNa31s9FXDiUDm0kcsO/U6LlMV52sc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bukskTZr0m6t+pnC0yyRbQUgdC7AJeZtgOlEyOz/ef3RL53LBvdzjBL2ijVmbKwvjPvrHVBUX2FWqZVk53lymoqTrkSUpeDuT2HsGUB57D489v3t6dKovWcsz48MCmKP5kYD8bOlgCDSI0ZmWEfU9teUYgUup0xh6ANQ9GqvPCI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=ID1+odDF; arc=none smtp.client-ip=95.215.58.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714754488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vO5DAzgmog7KilXxDbcqZljq54cRteB1aUJEF70aaEA=; b=ID1+odDFJLMZGM3SFRFN/it22j2tE6PB8T4rM5qgJNX0oYvgYzM229nYyPVDaM+LWJEZiu aHVmjFie4ANXab7sIeE9quZDhB2NVSjdJBo4woMpry27gi5oOReU3eUao5BRAGMTAM9YFL ScxEtD5r22quzhKe2nPrNu3rNo/gq+c= From: Sui Jingfeng To: Andrzej Hajda Cc: Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Sui Jingfeng Subject: [PATCH v5 02/10] drm/bridge: Add a helper to setup both the of_node and fwnode of drm bridge Date: Sat, 4 May 2024 00:40:58 +0800 Message-Id: <20240503164106.1172650-3-sui.jingfeng@linux.dev> In-Reply-To: <20240503164106.1172650-1-sui.jingfeng@linux.dev> References: <20240503164106.1172650-1-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-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT The newly added helper is drm_bridge_set_node(), the reason behind of this introduction is that the name 'of_node' itself has a smell of DT dependent, when we are going to make drivers truly DT independent, we have to has a way to hide it from its user referencing and/or dereferencing. Please note that the introduction of drm_bridge_set_node() is actually trying to follow the convention used by driver core, see device_set_node() for reference. While at it, include the of.h header as the drm_bridge struct always has the of_node as its member. Therefore drop the forward declaration. Signed-off-by: Sui Jingfeng --- include/drm/drm_bridge.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index a1bb19425761..b18e7c2f62c9 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -26,14 +26,13 @@ #include #include #include +#include #include #include #include #include -struct device_node; - struct drm_bridge; struct drm_bridge_timings; struct drm_connector; @@ -790,6 +789,13 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, struct drm_bridge *previous, enum drm_bridge_attach_flags flags); +static inline void +drm_bridge_set_node(struct drm_bridge *bridge, struct fwnode_handle *fwnode) +{ + bridge->fwnode = fwnode; + bridge->of_node = to_of_node(fwnode); +} + #ifdef CONFIG_OF struct drm_bridge *of_drm_find_bridge(struct device_node *np); #else -- 2.34.1