]> git.dujemihanovic.xyz Git - u-boot.git/commit
regmap: clean up regmap allocation
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 19 Apr 2018 03:14:01 +0000 (12:14 +0900)
committerTom Rini <trini@konsulko.com>
Mon, 7 May 2018 19:15:27 +0000 (15:15 -0400)
commit8c1de5e08b845eb71c9a247d16bc81ebdab0598d
tree3cfa1a137c58f01b0a658bc53d0efec5c1734aca
parent9ce751a6f5d6683b0fabd3cfc62da7e9f30bc57f
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: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: fixup cpu_info-rcar.c]
Signed-off-by: Tom Rini <trini@konsulko.com>
arch/arm/mach-rmobile/cpu_info-rcar.c
drivers/core/regmap.c
drivers/phy/sti_usb_phy.c
drivers/pinctrl/pinctrl-sti.c
drivers/reset/sti-reset.c
drivers/sysreset/sysreset_sti.c
drivers/usb/host/dwc3-sti-glue.c
include/regmap.h
test/dm/regmap.c