diff options
author | Mark Brown <broonie@linaro.org> | 2013-08-29 13:32:36 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-29 13:32:36 +0100 |
commit | 65c180fd95993abc31c8770e014ebedade46b623 (patch) | |
tree | 90052dbe66ac706e8689f321bcfa5cc21ccd70e0 /drivers/base | |
parent | b6752123ccef4eec3c70c20dbdfc05d1674319c5 (diff) | |
parent | 515f2261703d09c6b647a5687b7d657dd5911065 (diff) |
Merge remote-tracking branch 'regmap/topic/cache' into regmap-rbtree
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/regmap/internal.h | 2 | ||||
-rw-r--r-- | drivers/base/regmap/regcache.c | 3 | ||||
-rw-r--r-- | drivers/base/regmap/regmap.c | 3 |
3 files changed, 4 insertions, 4 deletions
diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h index 29c83160ca2..5308e3e870b 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); 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); diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index 3455f833e47..e2abd0548e7 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c @@ -241,9 +241,6 @@ int regcache_write(struct regmap *map, BUG_ON(!map->cache_ops); - if (!regmap_writeable(map, reg)) - return -EIO; - if (!regmap_volatile(map, reg)) return map->cache_ops->write(map, reg, value); diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index e0d0c7d8a5c..0e85367e504 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -1261,6 +1261,9 @@ int _regmap_write(struct regmap *map, unsigned int reg, int ret; void *context = _regmap_map_get_context(map); + if (!regmap_writeable(map, reg)) + return -EIO; + if (!map->cache_bypass && !map->defer_caching) { ret = regcache_write(map, reg, val); if (ret != 0) |