Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2422975pxu; Fri, 18 Dec 2020 12:55:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZn1FZ++I/ByDCECaU6PkZb/xCjCT8OqXYAzhiL41CiIyWKLTXON2MWmyL+AEbQcLLBKQr X-Received: by 2002:a05:6402:3192:: with SMTP id di18mr6259495edb.332.1608324932601; Fri, 18 Dec 2020 12:55:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608324932; cv=none; d=google.com; s=arc-20160816; b=Uyf+MyMoMAvYgABWwK+8CGkzvqQXxkwcB8dXci+C3JSYW9nZKncKykwcItn0LRj9tr PgPy8oUUsxk361aBlonbYhlluGd9KxiM8XJNWdpTWOx4Jr0smtXZp+5Np3z27/yZqX3z U+e/kTG7/Y+F7/NMhgo+VczGvriugXYsSeppLECWxeIvCHuAaRd7CPk2Uxw69fnw9wZn cxAMYvPfKsMneRDVf9wJWOqKD/teW/9DTJ2nkVt6vih+UI+bgaWij7VbJL0xRjv6i8hP 0HysGCHZ07MVufAqfUh6/fz05AXSfCUhiAzUnS8jeDUKE6jwfOuu20NGgslSAh3NeAy1 YaIw== 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=KXrr7IZWzLkrIEEAJZkNx59hR+5zjRk1IUXIGsENSRI=; b=KwiBMwfertMZSMlu/jaL5OhjFJKMJ/fokEL2uvizcPY5PE8UNJLXgIB92k1nhuOMCi FtUfIzsh7gt+nt8M3swK/U60QAutbp4LxCKLmozjwhzoaFti6tP9L+a8q8md+avqmj4R DI7eirqeABwc6HzoQQW/WFOkYRyOkE8mwr3sjP8r6NvbBbbiTL7Hpg9H4YzdE7A614jA ki3cOOxT3E9aWwk8VXE/3R0YLiWDWF6gee7CSPa6qZyIPBo6uUCrzCcsO0XAWFc3ZNQI 6s3O0zs/GyCkb8L2KPmiKfDVRKNpL2B3OIZt2MIuNNojsyd6/4Gr9crI0fGvD1kh1l37 1fZA== 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 cw4si5123368ejb.196.2020.12.18.12.55.09; Fri, 18 Dec 2020 12:55:32 -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 S2387582AbgLRUiT (ORCPT + 99 others); Fri, 18 Dec 2020 15:38:19 -0500 Received: from mga02.intel.com ([134.134.136.20]:46793 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725910AbgLRUiT (ORCPT ); Fri, 18 Dec 2020 15:38:19 -0500 IronPort-SDR: doEqL8q4X8ifN6RU6EYrU4q5be2CnNLqwhM6Jn7AXGZAktdPvCDQeEu7rysPSiDqHXdS0o3OL9 n85zkTZbdUBw== X-IronPort-AV: E=McAfee;i="6000,8403,9839"; a="162552123" X-IronPort-AV: E=Sophos;i="5.78,431,1599548400"; d="scan'208";a="162552123" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Dec 2020 12:36:33 -0800 IronPort-SDR: CJGGsgjAnED17c7rHYmqR189sjRUg428iZbJS01yIwtKb/2js5v66dvmM7+PG2bXoXTZCA4RJ6 B02vIPGoFyZw== X-IronPort-AV: E=Sophos;i="5.78,431,1599548400"; d="scan'208";a="339143177" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Dec 2020 12:36:27 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kqMVE-00FgLb-BC; Fri, 18 Dec 2020 22:37:28 +0200 Date: Fri, 18 Dec 2020 22:37:28 +0200 From: Andy Shevchenko To: Daniel Scally Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-media@vger.kernel.org, devel@acpica.org, 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, 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 Subject: Re: [PATCH v2 06/12] software_node: Add support for fwnode_graph*() family of functions Message-ID: <20201218203728.GC4077@smile.fi.intel.com> References: <20201217234337.1983732-1-djrscally@gmail.com> <20201217234337.1983732-7-djrscally@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201217234337.1983732-7-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 Thu, Dec 17, 2020 at 11:43:31PM +0000, Daniel Scally wrote: > From: Heikki Krogerus > > This implements the remaining .graph_* callbacks in the > fwnode operations structure for the software nodes. That makes > the fwnode_graph*() functions available in the drivers also > when software nodes are used. > > The implementation tries to mimic the "OF graph" as much as > possible, but there is no support for the "reg" device > property. The ports will need to have the index in their > name which starts with "port@" (for example "port@0", "port@1", > ...) and endpoints will use the index of the software node > that is given to them during creation. The port nodes can > also be grouped under a specially named "ports" subnode, > just like in DT, if necessary. > > The remote-endpoints are reference properties under the > endpoint nodes that are named "remote-endpoint". ... > + while ((port = software_node_get_next_child(parent, old))) { > + if (!strncmp(to_swnode(port)->node->name, "port", 4)) > + return port; > + old = port; > + } Dunno if we need defines for port and its length here. ... > + ret = kstrtou32(swnode->parent->node->name + 5, 10, &endpoint->port); But here at least comment is needed what 5 means ('port@' I suppose). > + if (ret) > + return ret; -- With Best Regards, Andy Shevchenko