Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4117573pxu; Mon, 30 Nov 2020 18:27:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJyyk6KBt5GdRunxDJAVjWfKyQ48blgMyQpI5kDPGf70CX4AiPsJ/NAMEIdLe0OxgJ5iCAO1 X-Received: by 2002:a17:906:490:: with SMTP id f16mr904401eja.12.1606789627811; Mon, 30 Nov 2020 18:27:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606789627; cv=none; d=google.com; s=arc-20160816; b=TYXsVbtwPfldNkSk1eu1+Nh6wx69+g4oqJ9dI4jpHi6mCwfZ5DjN6uFgq9ire0RL2E PmP98klsS+VxwcfcqqaL5YMQ4QUI+u0E4QeGrjKIH9BqHVdi0ce+a+dNlwanJxhSGEwH NAMFiFoBgrj+kHqOeVMd21rDhdjcR/wM/P3I0/LChFJ66VRAk7JLJBNgXlS7Xv+NVNwl UX9ebHiKddU0tW+SbPXE0Imf+OLYsvvQv583N6+koPnbmskHxLMYtHVOw5Z1AQD2yRt3 s4BfJJuziGiJZ594WuETSdbmJQfC0dnljmKIWnc4Gc1xTBAedU5V670fuboxiU1J42OE xGvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PMb1BK7H4hE+7l+DvQKpGtd/9FDqYdPyMmcrykm3ldg=; b=HV4QMcGiczCQOAyyq9aExu9w0qKxaqvzlTdz5uOmmi+hwuUqD4OTO5aHZMZ7xhIJwZ CxL1tIl4N5T4s2xU36hkIrHhJWAHAKvhCHLxgrGR7OZs5+5eueQem6Z9VXWGMWwwGmB2 VBaPnBNlZ7WDFK0s/4YeKXvL1nCD7Pnn+4p9x4tPJvFHszL2FhF4VBbGROqG8jk1PCn6 Ih4Lf96afo5aQf/KaOuIGrxyfnNQIuSjoO2rb6vzqRqXzgL28G1ehSzHx61baXOGrn0U 561au6BovFuylVTf+XN7CjZYt/dVX/qxc5Vq35Mb+uioJ8LtyK817EZU7V5rtIEMDx2a ZALA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=T2K5et+9; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w4si78033ejy.251.2020.11.30.18.26.45; Mon, 30 Nov 2020 18:27:07 -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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=T2K5et+9; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728593AbgK3QJ1 (ORCPT + 99 others); Mon, 30 Nov 2020 11:09:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726977AbgK3QJ0 (ORCPT ); Mon, 30 Nov 2020 11:09:26 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AF44C0613D2; Mon, 30 Nov 2020 08:08:46 -0800 (PST) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 745ECB26; Mon, 30 Nov 2020 17:08:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1606752523; bh=FvubFNRozegHWCNhGg55hAtFucfGflP9T603px4M0go=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=T2K5et+9pga7sIvBaNehVwika0V4p2f+g2ovINHI7xQFwQDpebDpXKeCfTOgsnPD9 uKT5G1i1zv1hIHlNtHlFcuQO5NFiVDAWRplxFUPpZtG7nx4nM4rzyy4gzgFCVSZkQS PFE2ZO2UhV4G5GOhds6NiH+uuYbMoeAUblqBsBas= Date: Mon, 30 Nov 2020 18:08:35 +0200 From: Laurent Pinchart To: Daniel Scally Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org, linux-media@vger.kernel.org, devel@acpica.org, rjw@rjwysocki.net, lenb@kernel.org, gregkh@linuxfoundation.org, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com, linus.walleij@linaro.org, bgolaszewski@baylibre.com, wsa@kernel.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, linux@rasmusvillemoes.dk, kieran.bingham+renesas@ideasonboard.com, jacopo+renesas@jmondi.org, laurent.pinchart+renesas@ideasonboard.com, jorhand@linux.microsoft.com, kitakar@gmail.com, heikki.krogerus@linux.intel.com Subject: Re: [PATCH 02/18] property: Add support for calling fwnode_graph_get_endpoint_by_id() for fwnode->secondary Message-ID: <20201130160835.GE14465@pendragon.ideasonboard.com> References: <20201130133129.1024662-1-djrscally@gmail.com> <20201130133129.1024662-3-djrscally@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201130133129.1024662-3-djrscally@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Daniel, Thank you for the patch. On Mon, Nov 30, 2020 at 01:31:13PM +0000, Daniel Scally wrote: > 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. > > Signed-off-by: Daniel Scally Reviewed-by: Laurent Pinchart > --- > Changes since RFC v3: > > Patch introduced. In discussion in the last submission I noted > that the CIO2 device doesn't have an ACPI fwnode - that turns > out to be true for _some_ devices but not others, so we need > this function to check the secondary too. > > drivers/base/property.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/base/property.c b/drivers/base/property.c > index a5ca2306796f..4ece6b086e36 100644 > --- a/drivers/base/property.c > +++ b/drivers/base/property.c > @@ -1162,6 +1162,10 @@ fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode, > best_ep_id = fwnode_ep.id; > } > > + if (!best_ep && fwnode && !IS_ERR_OR_NULL(fwnode->secondary)) > + return fwnode_graph_get_endpoint_by_id(fwnode->secondary, port, > + endpoint, flags); > + > return best_ep; > } > EXPORT_SYMBOL_GPL(fwnode_graph_get_endpoint_by_id); -- Regards, Laurent Pinchart