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>
diff --git a/drivers/pinctrl/pinctrl-sti.c b/drivers/pinctrl/pinctrl-sti.c
index ed137d6..f0cd845 100644
--- a/drivers/pinctrl/pinctrl-sti.c
+++ b/drivers/pinctrl/pinctrl-sti.c
@@ -61,7 +61,7 @@
int bank = pin_desc->bank;
int pin = pin_desc->pin;
- sysconfreg = (unsigned long *)plat->regmap->base;
+ sysconfreg = (unsigned long *)plat->regmap->ranges[0].start;
switch (bank) {
case 0 ... 5: /* in "SBC Bank" */
@@ -95,7 +95,7 @@
unsigned long *sysconfreg;
int bank = pin_desc->bank;
- sysconfreg = (unsigned long *)plat->regmap->base + 40;
+ sysconfreg = (unsigned long *)plat->regmap->ranges[0].start + 40;
/*
* NOTE: The PIO configuration for the PIO pins in the