Skip to content
Commit 8c1de5e0 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Tom Rini
Browse files

regmap: clean up regmap allocation



Putting zero length array at the end of struct is a common technique
to embed arbitrary length of members.  There is no good reason to let
regmap_alloc_count() branch by "if (count <= 1)".

As far as I understood the code, regmap->base is an alias of
regmap->ranges[0].start, but it is not helpful but make the code
just ugly.

Rename regmap_alloc_count() to regmap_alloc() because the _count
suffix seems pointless.

Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
[trini: fixup cpu_info-rcar.c]
Signed-off-by: default avatarTom Rini <trini@konsulko.com>
parent 9ce751a6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment