regmap: rework ->max_register handling
authorJan Dakinevich <jan.dakinevich@salutedevices.com>
Fri, 26 Jan 2024 20:08:36 +0000 (23:08 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 5 Feb 2024 14:32:35 +0000 (14:32 +0000)
commit0ec74ad3c157bd4bcbcc8b294777733687e8cd2a
tree853dee94f5d1bd7cc8a8e41bf50fc08ef5438d4c
parent6613476e225e090cc9aad49be7fa504e290dd33d
regmap: rework ->max_register handling

When regmap consists of single register, 'regmap' subsystem is unable to
understand whether ->max_register is set or not, because in both cases it
is equal to zero. It leads to that the logic based on value of
->max_register doesn't work. For example using of REGCACHE_FLAT fails.

This patch introduces an extra parameter to regmap config, indicating
that zero value in ->max_register is authentic.

Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
Link: https://lore.kernel.org/r/20240126200836.1829995-1-jan.dakinevich@salutedevices.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/internal.h
drivers/base/regmap/regcache-flat.c
drivers/base/regmap/regcache.c
drivers/base/regmap/regmap.c
include/linux/regmap.h