Re: [PATCH] pinctrl: use non-devm kmalloc versions for free functions

From: Tony Lindgren
Date: Fri May 12 2017 - 13:19:18 EST


* Tony Lindgren <tony@xxxxxxxxxxx> [170512 08:39]:
> * Linus Walleij <linus.walleij@xxxxxxxxxx> [170512 02:28]:
> > On Thu, May 11, 2017 at 4:20 PM, Andre Przywara <andre.przywara@xxxxxxx> wrote:
> > > Linus, can you shed some light if this array creation serves some purpose?
> >
> > Tony [author of this function] can you look at this?
> >
> > The code in pinctrl_generic_free_groups() does look a bit weird,
> > allocating these indices just to remove the radix tree.
> > Do you think we can clean it up?
>
> Yup indeed it seems totally pointless. Also the same code can be
> removed from pinmux_generic_free_functions().
>
> It must be left over code from my initial attempts to to add
> generic pinctrl groups and functions when I still though we need
> to keep a static array around for the indices to keep pinctrl
> happy. Then I probably did some robotic compile fixes after
> updating things to use just the radix tree and added indices
> locally to both functions..

Hmm no that, can't be, I think I figured it out.. See the patch
below.

Regards,

Tony

8< ---------------------------