Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1334809ybe; Fri, 13 Sep 2019 15:00:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwEJev9G/Bdim1gZQRCZVWkPRBPSJMmmLisrhPDYoZV0e8R2GVHsgxobJDW2YdymqwqhaH+ X-Received: by 2002:a17:906:9414:: with SMTP id q20mr41450460ejx.139.1568412027564; Fri, 13 Sep 2019 15:00:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568412027; cv=none; d=google.com; s=arc-20160816; b=uP2fHG0k96J0PgkPRlDe221pIp84SnNBhjSI6vD8+WCuHaG7Y9SUcD1vqKbU1RHmzp oc52uLTSB6m9cghEJf1GyiCmVmAWm4hzLTRISc3yHXqlqtMsIPctijkJFuD4rXByj8oU T57mys46MaN7mYqw51ZEAzsgiJI1RmoTCeHtid04kKL5UHJff/kffTVUgxMJFOcVsSQp vETjpwZ1LQ6y8aPWi7Syzijj/GJJdjPUZ+kauKpbXBRPJoWgwrPunoxeWVoFDYBZezVc zBjSsn83CavwzFldPwj93/I+H/Gxo2X3efqd6WNCiIIBLM+5Hmeug5QLpG1sJ6Zupiwr 9IDw== 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=AQ3PXKKEYAPpTNJc/PTOp8Ob+kx8WcDFX3XJj1y+xiY=; b=Jr91tMHon8ROHoxpZAnva6q2X4y6BlrHkPffDzSWLvsJrDO+FECbwLU/OoxP/Gszy7 05GIKehF3gzEjH/Kvpqd3frZiFSVkaO6r7/TZJEKXY77iqfyrOJzKu0qPd6g8k24ZafO 8Mh7FFvqmRhbIwpzZY2bPqAPd1wGM3PrnhaXvZSvZYRgStgM+dJi0MiimetW7EClNVxD KdRZQOvBaTKv8+aOYe+8uQoZEP3aHXDNW1smDn9YQk/mz1CDFoiBRADKEIxja/e4RY9L JQh+P9qjWYmG60Cw2Bf0OgNI9Hy9m/rqGYU3SWJ1yEJp/OPoz4PZWBVV1H5VTZFjWAxK axLg== 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 f21si19147265edb.379.2019.09.13.15.00.01; Fri, 13 Sep 2019 15:00:27 -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 S1731395AbfIMV6L (ORCPT + 99 others); Fri, 13 Sep 2019 17:58:11 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:41253 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725747AbfIMV6L (ORCPT ); Fri, 13 Sep 2019 17:58:11 -0400 Received: by mail-oi1-f196.google.com with SMTP id w17so3898641oiw.8; Fri, 13 Sep 2019 14:58:10 -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=AQ3PXKKEYAPpTNJc/PTOp8Ob+kx8WcDFX3XJj1y+xiY=; b=QYNCSThMWO39OjcVuLVPo2qYCSbsZyzXqHd86wEUvmWW3aaFPwgEKaVnh+aTpbnHAe lHjiktVHISddLepOS9ud1QPM3nct+Aqjny9G11MgZhWRcfME+APAuiBKW130IJG36aRh 2hHDXZNXvwPqc/gTTFrDwRahz0C7T1GbtFRKyRfT+MVHGQ6KyBzwBardY5QlGJTBDynJ AUbcplBmZE+/LP61OkeaTQZIYxb/NIQlp8zhqsyt61IhO8HTEMbpi0V9TFiOl4/yJVbX GsHMTUf0kY3zdRtiQGJf2Xf7TvWfg+pq9we8WkXdY2Lhg9+tFRXJDN+8l093tWTMsm90 KH0g== X-Gm-Message-State: APjAAAXVNEmNBPaDkFhCRET6YxN4VFO6OgKyL+ZIGyOveqyR3VCqOm/5 zngTwJxp3HbgI9rZZlnSkg== X-Received: by 2002:a05:6808:b19:: with SMTP id s25mr5498975oij.126.1568411890436; Fri, 13 Sep 2019 14:58:10 -0700 (PDT) Received: from localhost (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id 34sm11938701ots.47.2019.09.13.14.58.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Sep 2019 14:58:09 -0700 (PDT) Date: Fri, 13 Sep 2019 16:58:09 -0500 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: <20190913215809.GA11833@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, 24 Aug 2019 15:28:46 +0200, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= 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(-) > Applied both patches, thanks. Rob