regmap: fix regcache_reg_present() for empty cache
authorIonut Nicu <ioan.nicu.ext@nsn.com>
Fri, 9 Aug 2013 10:09:15 +0000 (12:09 +0200)
committerMark Brown <broonie@linaro.org>
Fri, 9 Aug 2013 11:47:29 +0000 (12:47 +0100)
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>
drivers/base/regmap/internal.h

index 29c83160ca29511adf7fe8c9ca9d77fe353a0781..5308e3e870bace7f49089355f2bc98088db47525 100644 (file)
@@ -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);
This page took 0.030709 seconds and 5 git commands to generate.