regmap: fix regcache_reg_present() for empty cache
Subsystems (2)
PATCH 2/3 regmap: fix regcache_reg_present() for empty cache
In the initial case when no reg_defaults values are provided and no register value was added to the cache yet, the cache_present bitmap is NULL. If this function is invoked for any register it should return false (i.e. the register is not cached) instead of true.
Signed-off-by Ionut Nicu <[email protected]>
--- drivers/base/regmap/internal.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/base/regmap/internal.h +1 -1
@@ -223,7 +223,7 @@ int regcache_set_reg_present(struct regmap *map, unsigned int reg);static inline bool regcache_reg_present (struct regmap *map,unsigned int reg) {if (!map->cache_present) -return true; +return false;if (reg > map->cache_present_nbits)return false;return map->cache_present[BIT_WORD (reg)] &BIT_MASK (reg);
Signature · 1 line
1.7.1
Quoted 5 lines · Ionut Nicu
In the initial case when no
reg_defaultsvalues are provided and no register value was added to the cache yet, thecache_presentbitmap is NULL. If this function is invoked for any register it should return false (i.e. the register is not cached) instead of true.
Applied, thanks.