[lkml]   [2012]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 03/20] pinctrl: Store mapping table as a list of chunks
On Mon, Feb 20, 2012 at 7:45 AM, Stephen Warren <> wrote:

> Instead of storing a single array of mapping table entries, which
> requires realloc()ing that array each time it's extended and copying
> the new data, simply store a list of pointers to the individual chunks.
> This also removes the need to copy the mapping table at all; a pointer
> is maintained to the original table, this saving memory.
> A macro for_each_maps() is introduced to hide the additional complexity
> of iterating over the map entries.
> This change will also simplify removing chunks of entries from the mapping
> table. This isn't important right now, but will be in the future, when
> mapping table entries are dynamically added when parsing them from the
> device tree, and removed when drivers no longer need to interact with
> pinctrl.
> Signed-off-by: Stephen Warren <>
> ---
> v2: Fixed kzalloc size parameter in pinctrl_register_mappings(),
>    add pr_error on kzalloc() failure, keep pinctrl_get() docs with
>    pinctrl_get() not pinctrl_get_locked(), make pinctrl_get_locked()
>    static, use list_add_tail instead of list_add, continue to duplicate
>    mapping table, don't remove __initdata from u300 mapping table.

Brilliant, applied.
Also tested on U300 up to this point, everything works just fine.

Linus Walleij
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2012-02-20 22:11    [W:0.267 / U:3.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site