From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759727AbcJaGNl (ORCPT ); Mon, 31 Oct 2016 02:13:41 -0400 Received: from mail-yw0-f196.google.com ([209.85.161.196]:33844 "EHLO mail-yw0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759636AbcJaGNj (ORCPT ); Mon, 31 Oct 2016 02:13:39 -0400 Date: Mon, 31 Oct 2016 01:13:36 -0500 From: Rob Herring To: Tony Lindgren Cc: Linus Walleij , "linux-kernel@vger.kernel.org" , Jon Hunter , Mark Rutland , Grygorii Strashko , Nishanth Menon , "linux-gpio@vger.kernel.org" , "devicetree@vger.kernel.org" , Linux-OMAP Subject: Re: [PATCH 1/4] pinctrl: Introduce generic #pinctrl-cells and pinctrl_parse_index_with_args Message-ID: <20161031061336.ya6jcjttvbgdqnld@rob-hp-laptop> References: <20161025164538.453-1-tony@atomide.com> <20161025164538.453-2-tony@atomide.com> <20161027141120.jqvul6q7iz5fjsmb@atomide.com> <20161028165338.y5fyavbw5xfxweg3@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161028165338.y5fyavbw5xfxweg3@atomide.com> User-Agent: Mutt/1.6.2-neo (2016-08-21) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 28, 2016 at 09:53:38AM -0700, Tony Lindgren wrote: > * Tony Lindgren [161027 07:59]: > > * Linus Walleij [161027 00:57]: > > > On Tue, Oct 25, 2016 at 6:45 PM, Tony Lindgren wrote: > > > > +/* > > > > + * For pinctrl binding, typically #pinctrl-cells is for the pin controller > > > > + * device, so either parent or grandparent. See pinctrl-bindings.txt. > > > > + */ > > > > +static int pinctrl_find_cells_size(const struct device_node *np, > > > > + const char *cells_name) > > > > +{ > > > > + int cells_size, error; > > > > + > > > > + error = of_property_read_u32(np->parent, cells_name, &cells_size); > > > > + if (error) { > > > > + error = of_property_read_u32(np->parent->parent, > > > > + cells_name, &cells_size); > > > > + if (error) > > > > + return -ENOENT; > > > > + } > > > > + > > > > + return cells_size; > > > > +} > > > > > > Can't we just hardcode this to "#pinctrl-cells" and skip the cells_name > > > parameter? We can parametrize it the day we need it instead. > > > > Sure we can do that. > > > > > The rest of the helpers look nice and clean. > > > > OK cool thanks, > > Below is an updated version of this patch with documentation updated > and cells_name removed. I'll repost the whole series once the DT > binding has been reviewed. > > Regards, > > Tony > 8< ------------------------- > From tony Mon Sep 17 00:00:00 2001 > From: Tony Lindgren > Date: Tue, 25 Oct 2016 08:33:34 -0700 > Subject: [PATCH] pinctrl: Introduce generic #pinctrl-cells and > pinctrl_parse_index_with_args > > Introduce #pinctrl-cells helper binding and generic helper functions > pinctrl_count_index_with_args() and pinctrl_parse_index_with_args(). > > Signed-off-by: Tony Lindgren > --- > .../bindings/pinctrl/pinctrl-bindings.txt | 44 ++++++- Acked-by: Rob Herring > drivers/pinctrl/devicetree.c | 144 +++++++++++++++++++++ > drivers/pinctrl/devicetree.h | 21 +++ > 3 files changed, 208 insertions(+), 1 deletion(-)