regmap: Check for register readability before checking cache during read
authorMark Brown <broonie@kernel.org>
Tue, 13 Jun 2023 20:07:16 +0000 (21:07 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 14 Jun 2023 11:27:16 +0000 (12:27 +0100)
commiteab5abdeb79f0f694c007c3a76a97902705c86f0
tree20f51b050d920e0fdc32bb27ac78ee7ce7c27f4b
parentb629c698eae745eb51b6d92395e2eee44bbf5f49
regmap: Check for register readability before checking cache during read

Ensure that we don't return a spurious cache hit for unreadable registers
(eg, with the flat cache which doesn't understand sparseness) by checking
for readability before we do a cache lookup.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230613-b4-regmap-check-readability-before-cache-v1-1-b144c0b01ed9@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap.c