From 8c1de5e08b845eb71c9a247d16bc81ebdab0598d Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 19 Apr 2018 12:14:01 +0900 Subject: 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 Reviewed-by: Simon Glass [trini: fixup cpu_info-rcar.c] Signed-off-by: Tom Rini --- drivers/reset/sti-reset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/reset') diff --git a/drivers/reset/sti-reset.c b/drivers/reset/sti-reset.c index 5d70e20c35..d8cc485ce6 100644 --- a/drivers/reset/sti-reset.c +++ b/drivers/reset/sti-reset.c @@ -217,7 +217,7 @@ phys_addr_t sti_reset_get_regmap(const char *compatible) return -ENODEV; } - return regmap->base; + return regmap->ranges[0].start; } static int sti_reset_program_hw(struct reset_ctl *reset_ctl, int assert) -- cgit v1.2.3