Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1661739pxu; Thu, 17 Dec 2020 15:47:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWX7nKaHZjCBBGmC9yw3tNqZPZoG6zexFqkrHlU5nIu4uQBuBuP0kjs6xq2R7FFqIK733q X-Received: by 2002:a05:6402:94c:: with SMTP id h12mr1862074edz.268.1608248838145; Thu, 17 Dec 2020 15:47:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608248838; cv=none; d=google.com; s=arc-20160816; b=0SPvaLYSsUTaakz1aTygTfsH3/cNpxMzS7uKGumHNfy6joljDOomXdFRxXb/Y/DJdd shKXJ74fR2T6AjAvB+3LdiPbGwTbOFBQlgPwUD1r9EKdcbGsZxR8aIQlhvaGM3ZNGa1+ UCnlawshEE8JMDKOyEWd4uNLr1j5z8a+RK+7pAFrTppo3ScYJaZkB1FhKNWLB5cZKFQE tzfHPUX+r+hrNreWVD8XWMY5xfK/H0R4hzY/OuvbQGZ4l2Q/68DatBsYLHjZovnS7uoj jO7v3pWYEt1dzBXvFATIolyUhVeVrbgm51YdLQiYTCfOp1PBAp3bSe6fyCb2SE4kx7l7 wPWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2D63LdgVtcR4/tv7YaOjAC2rW6v7Ot1epxf/JXyTdFI=; b=APXUJS32OWFxX2r56COvfCMoKd9wJKVkSegDz4JIzNzr29uGhXYC+kk5jTQytXqIAR p/+gaQKGK9+m7pI12IHI9PutEEk9sWaiZAMPixMGpMY7aJ9b1x0Jh9wGofmHsnG2I29M ZpA1s58Bw4Y81SmLiylfu6Jd/5VYwy8qpgDF12cfM94sYTFP+mZXF8/aJCUszlfQyRJL e8JHWqh44KOjYx2nih+S97uEBjWMzzPwqdAG0V7Hu7KGa0grzVUhXeevz/nEcsvoNnip kKb7LcJPEVWO3gBs8b+fLlHPdPpVnKoaEEigtoZTeZp2U1j48lIzS8xffoP1nyjqs7ZP NF9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aDKCoO63; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l28si5083252edj.68.2020.12.17.15.46.55; Thu, 17 Dec 2020 15:47:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aDKCoO63; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732330AbgLQXoj (ORCPT + 99 others); Thu, 17 Dec 2020 18:44:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732201AbgLQXoh (ORCPT ); Thu, 17 Dec 2020 18:44:37 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55EE0C06138C; Thu, 17 Dec 2020 15:43:57 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id v14so531558wml.1; Thu, 17 Dec 2020 15:43:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2D63LdgVtcR4/tv7YaOjAC2rW6v7Ot1epxf/JXyTdFI=; b=aDKCoO63cjworyHY5zkMXmUCGgG2xTtZSue16SQEriXx4wn29dqrvrjrqqHEdzoeIQ 3X+rp09nI04kgEk7BCL68WiCuRrp9xZXmfUG3aTZcz0tBGu2CGz4L6TFIFLyDDri1GrB t6wMLhOURcIt5KzV7+UDBfA9vhXlhkT2xn1CVHyD3YBUKi1fmrmiY33l1epNRgFIemUW pSZGvb+dY7CwPCOFurNYWiqvGSHXLlBurZxv+2nMFuQmdWixFc/wqQ9t/nB3N+L4babb BE817J7hYjSuljVyrLtzmBXaqL6zvn4+CtXV8ymFtSvoBQdXsqZz4C63suuqmxPC4nPv AeSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2D63LdgVtcR4/tv7YaOjAC2rW6v7Ot1epxf/JXyTdFI=; b=F+VqNP9NMA9c2qyIf3knUP8X3OkFjEq0V2KPamRgeEHkENbOkiSAD28t3GbiOGZyPX YYNMFJCrKPtMYeWtduit4eXaJ1CnNCIaxJ7VcFMoCs0XpisR8H4ulvkvNZ28/8oSacOi toacUZo5AkqxndZpYNi8w2hj8cQbGAbHRBS5niXJw2YJWh7yvkfCVdMy16s4fV6Cf7ks s01aypq1KPDwjzqyJ/HwMMavP9rB1LtjAP4TW/yeoYb977c8zS1woYNgXAP18Vb9QIWi woGvWY/mZVsGKXX0a7I+KPoEX1ujGyY+F16cWQFVdYiPDfxTnWSaTFuKlYEoW2vzdoV0 0PRw== X-Gm-Message-State: AOAM530XMu1+RQoxuFaEiAAohbpb0NygXLzEw5p+segzJc0Ro/WzoF8d S8R7OJGOvGrrtWIdz4grgh5mIdpHBjNx/jFV X-Received: by 2002:a1c:7213:: with SMTP id n19mr1633738wmc.14.1608248636146; Thu, 17 Dec 2020 15:43:56 -0800 (PST) Received: from valhalla.home ([2.29.208.56]) by smtp.gmail.com with ESMTPSA id o3sm1873575wrc.93.2020.12.17.15.43.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 15:43:55 -0800 (PST) From: Daniel Scally To: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-media@vger.kernel.org, devel@acpica.org Cc: rjw@rjwysocki.net, lenb@kernel.org, gregkh@linuxfoundation.org, yong.zhi@intel.com, sakari.ailus@linux.intel.com, bingbu.cao@intel.com, tian.shu.qiu@intel.com, mchehab@kernel.org, robert.moore@intel.com, erik.kaneda@intel.com, pmladek@suse.com, rostedt@goodmis.org, sergey.senozhatsky@gmail.com, andriy.shevchenko@linux.intel.com, linux@rasmusvillemoes.dk, laurent.pinchart+renesas@ideasonboard.com, jacopo+renesas@jmondi.org, kieran.bingham+renesas@ideasonboard.com, linus.walleij@linaro.org, heikki.krogerus@linux.intel.com, kitakar@gmail.com, jorhand@linux.microsoft.com, Laurent Pinchart Subject: [PATCH v2 03/12] property: Call fwnode_graph_get_endpoint_by_id() for fwnode->secondary Date: Thu, 17 Dec 2020 23:43:28 +0000 Message-Id: <20201217234337.1983732-4-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201217234337.1983732-1-djrscally@gmail.com> References: <20201217234337.1983732-1-djrscally@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This function is used to find fwnode endpoints against a device. In some instances those endpoints are software nodes which are children of fwnode->secondary. Add support to fwnode_graph_get_endpoint_by_id() to find those endpoints by recursively calling itself passing the ptr to fwnode->secondary in the event no endpoint is found for the primary. Reviewed-by: Andy Shevchenko Reviewed-by: Laurent Pinchart Signed-off-by: Daniel Scally --- Changes in v2: - Some rearranging of the conditionals drivers/base/property.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/base/property.c b/drivers/base/property.c index bc9c634df6df..ddba75d90af2 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -1163,7 +1163,14 @@ fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode, best_ep_id = fwnode_ep.id; } - return best_ep; + if (best_ep) + return best_ep; + + if (fwnode && !IS_ERR_OR_NULL(fwnode->secondary)) + return fwnode_graph_get_endpoint_by_id(fwnode->secondary, port, + endpoint, flags); + + return NULL; } EXPORT_SYMBOL_GPL(fwnode_graph_get_endpoint_by_id); -- 2.25.1