Re: [PATCH 1/4] pinctrl: Introduce generic #pinctrl-cells and pinctrl_parse_index_with_args

From: Tony Lindgren
Date: Fri Oct 28 2016 - 12:53:51 EST


* Tony Lindgren <tony@xxxxxxxxxxx> [161027 07:59]:
> * Linus Walleij <linus.walleij@xxxxxxxxxx> [161027 00:57]:
> > On Tue, Oct 25, 2016 at 6:45 PM, Tony Lindgren <tony@xxxxxxxxxxx> 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< -------------------------