diff options
author | Ionut Nicu <ioan.nicu.ext@nsn.com> | 2013-08-09 06:09:15 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-09 07:47:29 -0400 |
commit | 1767da9e8e9a1dc1416d6bb1029b8cf5659dac2a (patch) | |
tree | e02498d7cebb9e5b1ba71fdfe36af52dec9fff18 /drivers/base/regmap | |
parent | c095ba7224d8edc71dcef0d655911399a8bd4a3f (diff) |
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 <ioan.nicu.ext@nsn.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/base/regmap')
-rw-r--r-- | drivers/base/regmap/internal.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h index 29c83160ca29..5308e3e870ba 100644 --- a/drivers/base/regmap/internal.h +++ b/drivers/base/regmap/internal.h | |||
@@ -223,7 +223,7 @@ int regcache_set_reg_present(struct regmap *map, unsigned int reg); | |||
223 | static inline bool regcache_reg_present(struct regmap *map, unsigned int reg) | 223 | static inline bool regcache_reg_present(struct regmap *map, unsigned int reg) |
224 | { | 224 | { |
225 | if (!map->cache_present) | 225 | if (!map->cache_present) |
226 | return true; | 226 | return false; |
227 | if (reg > map->cache_present_nbits) | 227 | if (reg > map->cache_present_nbits) |
228 | return false; | 228 | return false; |
229 | return map->cache_present[BIT_WORD(reg)] & BIT_MASK(reg); | 229 | return map->cache_present[BIT_WORD(reg)] & BIT_MASK(reg); |