Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3754053pxu; Mon, 30 Nov 2020 09:34:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPp3KeC8WTNS56x2YqZJ4OU+ZL56WSnpBu+dddI/auCuDfVTpLt66YRLtcBKHZ3emQtmE5 X-Received: by 2002:ac2:43cc:: with SMTP id u12mr9617016lfl.54.1606757659333; Mon, 30 Nov 2020 09:34:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606757659; cv=none; d=google.com; s=arc-20160816; b=RdWroUGPkryWpX/3f+/urYq+2WHdu3Akz3awAtZl+wjuwcde0NWN6xozAqtMCmVLVt MeJ+HdnXeuIbJ4+oq6RVjwpM7dIKL4GBfw5C2uDAOMqpajIR79lkjDBaPSP+r016YKmH DV+Z/Q1BXS6LuZRaUDDeDAAEEINfo9rquFAhtmTL4pHA5rvDGqHY7rrwixA/mZWtifix J8aSQYmeUBx6SZvb/cz2WKhc0jbCcdqtGvRKXXpau/j5WfEV2UhrQz0PsA2qlKl2IWAv TI8oDXUDH9uD3Iq6/Cku+nY1DcbwQXi4Vw7cY0cNMZkrGRvjm3T6znSHNYKlEV/qp9D2 i19g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=JmZHRHaOtTtjT7SQqf7n3cjqgh2yqTlCneeoI/UrihQ=; b=kW86/ImNDAnR3UJHF0FIYPecUwR3DRsO4RU05N5u9zE9klXJ30zn9sdaC5d3MyteiN Yq1xtv/pVNFgeCVfKZvMtFBP0QfXM7UyWGZOc0osIDDJR7a/CP/T7kOh7K8Jzxfj8mGl pSXW/5pvWi1M3Dl+26fAgGSbhgrPCQfRcexSrd/Z1/wFLQ7vD76jDAD3/DfTSVeGwZuh Nm0KUASrId/l6LsvazJ7hqGOayVRUSUocbbkBn910UbU8hoJQNTupuTQ87wzorgKSEcu JBkfMHVSH0Y3e5K/wVxUDkLHE67ZfnNVq+51A8V2oqjPWfSnOrHDB/LraAVmfU/MMAl/ J+2Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n25si9505391edy.231.2020.11.30.09.33.55; Mon, 30 Nov 2020 09:34:19 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387505AbgK3R3v (ORCPT + 99 others); Mon, 30 Nov 2020 12:29:51 -0500 Received: from mga12.intel.com ([192.55.52.136]:3449 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727522AbgK3R3s (ORCPT ); Mon, 30 Nov 2020 12:29:48 -0500 IronPort-SDR: wCgEVGDSaN1G2V0oo8LQqx9gVMAVCQXQe+BmEuTHH8fkqsPuT1KcWDFEMYVzSwIPl3PGobmC5N WG1rM7q+mTMw== X-IronPort-AV: E=McAfee;i="6000,8403,9821"; a="151926347" X-IronPort-AV: E=Sophos;i="5.78,382,1599548400"; d="scan'208";a="151926347" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2020 09:28:07 -0800 IronPort-SDR: bMiHDrGqoEELFLWE0SnE1SFrlaHerINAUOIukch1wRXikV1HFp8hZBtEXetLOgaI9XO+g2p0ou P0zwxpatR65g== X-IronPort-AV: E=Sophos;i="5.78,382,1599548400"; d="scan'208";a="372404058" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2020 09:28:00 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kjmyy-00B5xb-Rs; Mon, 30 Nov 2020 19:29:00 +0200 Date: Mon, 30 Nov 2020 19:29:00 +0200 From: Andy Shevchenko 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, 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: <20201130172900.GM4077@smile.fi.intel.com> References: <20201130133129.1024662-1-djrscally@gmail.com> <20201130133129.1024662-3-djrscally@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201130133129.1024662-3-djrscally@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. One nit below, after addressing: Reviewed-by: Andy Shevchenko ... > + 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; Can we, please, do 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; ? This 'if (fwnode && !IS_ERR_OR_NULL(fwnode->secondary))' becomes kinda idiomatic to the cases when we need to proceed primary followed by the secondary in cases where it's not already done. > } > EXPORT_SYMBOL_GPL(fwnode_graph_get_endpoint_by_id); -- With Best Regards, Andy Shevchenko