Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp670174ybe; Mon, 2 Sep 2019 07:27:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRgr1Djn/Q6RffcgEzMBtKpmm6CeXSL6tWg2TgwOuEf/y+eRf1wqefTRJOTg+Nhnc2DHWv X-Received: by 2002:a17:902:fe01:: with SMTP id g1mr29766956plj.154.1567434467469; Mon, 02 Sep 2019 07:27:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567434467; cv=none; d=google.com; s=arc-20160816; b=PVmx9wznRQQVq15tXo7zY6sCPZ0lRz+BgpPSx/lmnkcHOppaiO5tw7GjuLJ0IrAZJQ t3hVeERXmswNaAviupAizpzpTLzL5aJ0qcYKNLh7qEesn9VaXd9ppfYp/KCqb4z5wc/I xkD0Lbbo1dvxq5VGrpF3v5PpLETcuZQ9OMWNtAE4DyVIIoDxCs4vWPK85nbCTr4HR/3F e+2oN0zrbvCG/R4bcZ2uV4L5d0Y83nw6xns9ODl+MRZ81mlRjnGcsOAfWbtdwg6xuTXJ 0CsqC7U41ubgcL5+2va/Zwu2/fKIL9hJ5ppagV3Bw81HtOkUgJ3oo1rTPVOTcWg+PUl2 Zuog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=ot30V47/iBS0yHDmKdi6h92CwtoqCpzSIGyUdC23LBs=; b=w8PUkqqX6W15GI9ZhvxXtb6GRC1EWFnhgaAvrF0J7TOggNIK9TgkytqSDSS4zu07iu YHisfcfZpT/HLzVxrFK/KqjeUxGQja6aa1Vlb1xYch9ONTR1rsbQ2/zsOZcmxbzNlyug BPIUXsXffC9vV0pBxYLuSnFjI8MlQJpWobHc26Um8e9aiokbUVP7LyuVbBxclZYSUKzq K5vmBqbjP84ZOx9I7U2zgLNS1kxUYpyWT0WpV9+d9t8PLyJcJLxoUrQAhWVd6IW5mt5F wN+A5bBzwO3tL5Igo5Oh04v21EfF05APD/wNOwhZ/7fc9BVDDIIpx7hFEQ164h+lmsic Dj7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21si11753570pgh.316.2019.09.02.07.27.31; Mon, 02 Sep 2019 07:27:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731491AbfIBO0n (ORCPT + 99 others); Mon, 2 Sep 2019 10:26:43 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:47047 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726421AbfIBO0n (ORCPT ); Mon, 2 Sep 2019 10:26:43 -0400 Received: by mail-wr1-f68.google.com with SMTP id h7so12896435wrt.13; Mon, 02 Sep 2019 07:26:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=ot30V47/iBS0yHDmKdi6h92CwtoqCpzSIGyUdC23LBs=; b=DKmJBL62s4BKsitaQZYkjhwsrKPx4BZxwQTWRBG58jPBxXLwKX7n4+LG+aWksU14vn 3b8HC0m8/d3X1dLfm2GU79CtibBrL6RLL3hpdh6wIFEY64HQcmGj4H+A4T1Ap3ZBeAUb IFafW5Q1yHVYSGwMi7g+AdVE9Z29Jpk5demO6o/nWosIehBTi3KnfsVpzome14dmii6m RRCnwM3Nec593Y41DZeDdIC6VnRtzn/bTOtM4UrQNU50pssgiJE7mW/L3QjL1DIHFyCv Dec9nRkDXpnHomOEUMJQDLA+n5XP7gWwfv8bQDkPs+ICJ9xaeDtr6D4XMim8yvjwF2Fw /MrQ== X-Gm-Message-State: APjAAAWsvCY51Q2D8k+sykQjIW8T25UjuD4h79WuKFynR0/pb8rULcvs 8SchQ4XvQfjViZmpMIFh7Q== X-Received: by 2002:a5d:6811:: with SMTP id w17mr1391676wru.181.1567434400948; Mon, 02 Sep 2019 07:26:40 -0700 (PDT) Received: from localhost ([212.187.182.166]) by smtp.gmail.com with ESMTPSA id h125sm33788405wmf.31.2019.09.02.07.26.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 07:26:40 -0700 (PDT) Date: Mon, 2 Sep 2019 15:26:39 +0100 From: Rob Herring To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Frank Rowand , devicetree@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, Will Deacon , Robin Murphy , Joerg Roedel , Matthias Brugger Subject: Re: [PATCH v1 2/2] of: Let of_for_each_phandle fallback to non-negative cell_count Message-ID: <20190902142639.GA13947@bogus> References: <20190824132846.8589-1-u.kleine-koenig@pengutronix.de> <20190824132846.8589-2-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190824132846.8589-2-u.kleine-koenig@pengutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 24, 2019 at 03:28:46PM +0200, Uwe Kleine-K?nig wrote: > Referencing device tree nodes from a property allows to pass arguments. > This is for example used for referencing gpios. This looks as follows: > > gpio_ctrl: gpio-controller { > #gpio-cells = <2> > ... > } > > someothernode { > gpios = <&gpio_ctrl 5 0 &gpio_ctrl 3 0>; > ... > } > > To know the number of arguments this must be either fixed, or the > referenced node is checked for a $cells_name (here: "#gpio-cells") > property and with this information the start of the second reference can > be determined. > > Currently regulators are referenced with no additional arguments. To > allow some optional arguments without having to change all referenced > nodes this change introduces a way to specify a default cell_count. So > when a phandle is parsed we check for the $cells_name property and use > it as before if present. If it is not present we fall back to > cells_count if non-negative and only fail if cells_count is smaller than > zero. > > Signed-off-by: Uwe Kleine-K?nig > --- > drivers/of/base.c | 25 +++++++++++++++++-------- > 1 file changed, 17 insertions(+), 8 deletions(-) Looks fine to me. I can apply with an ack from the iommu folks on patch 1. Rob