From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hiroshi Doyu Subject: Re: [PATCHv5 1/9] of: introduce of_property_for_earch_phandle_with_args() Date: Thu, 21 Nov 2013 15:12:18 +0200 Message-ID: <20131121151218.befbb483c0cf09cdcd4cd4dd@nvidia.com> References: <1384853593-32202-1-git-send-email-hdoyu@nvidia.com> <1384853593-32202-2-git-send-email-hdoyu@nvidia.com> <20131121124328.46BC1C40A2C@trevor.secretlab.ca> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20131121124328.46BC1C40A2C-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Grant Likely Cc: "mark.rutland-5wv7dgnIgG8@public.gmane.org" , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org" , Stephen Warren , "swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org" , "will.deacon-5wv7dgnIgG8@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org" , "thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" , "galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org" , "linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" List-Id: linux-tegra@vger.kernel.org On Thu, 21 Nov 2013 13:43:28 +0100 Grant Likely wrote: > On Tue, 19 Nov 2013 11:33:05 +0200, Hiroshi Doyu wrote: > > The following pattern of code is tempting: > > > > for (i = 0; !of_parse_phandle_with_args(np, list, cells, i, args); i++) > > > > Signed-off-by: Hiroshi Doyu > > That's a very minimal commit message. Can you elaborate please. The above can be: " The following pattern of code is tempting to add a new member for of_property_for_each_*() family as an idiom. for (i = 0; !of_parse_phandle_with_args(np, list, cells, i, args); i++) ; " Actual usage is here: int i; struct of_phandle_args args; of_property_for_each_phandle_with_args(dev->of_node, "iommus", "#iommu-cells", i, &args) { pr_debug("%s(i=%d) %s\n", __func__, i, dev_name(dev)); if (!of_find_iommu_by_node(args.np)) return -EPROBE_DEFER; Is this acceptable?