Commit d6409475 authored by Jeongtae Park's avatar Jeongtae Park Committed by Mark Brown

regmap: cache: set max_register with reg_stride

Current logic does not consider multi-stride cases,
the max_register have to calculate with reg_stride
because it is a kind of address range.
Signed-off-by: default avatarJeongtae Park <jtp.park@samsung.com>
Link: https://lore.kernel.org/r/20220425114613.15934-1-jtp.park@samsung.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent bd941dfa
......@@ -183,8 +183,8 @@ int regcache_init(struct regmap *map, const struct regmap_config *config)
return 0;
}
if (!map->max_register)
map->max_register = map->num_reg_defaults_raw;
if (!map->max_register && map->num_reg_defaults_raw)
map->max_register = (map->num_reg_defaults_raw - 1) * map->reg_stride;
if (map->cache_ops->init) {
dev_dbg(map->dev, "Initializing %s cache\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment