Skip to content

Commit

Permalink
regmap: Reset cache status when reinitialsing the cache
Browse files Browse the repository at this point in the history
When we reinitialise the cache make sure that we reset the cache access
flags, ensuring that the reinitialised cache is in the default state
which is what callers would and do expect given the function name.

This is particularly likely to cause issues in systems where there was no
cache previously as those systems have cache bypass enabled, as for the
wm8994 driver where this was noticed.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Jan 20, 2012
1 parent dcd6c92 commit 421e8d2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ int regmap_reinit_cache(struct regmap *map, const struct regmap_config *config)
map->precious_reg = config->precious_reg;
map->cache_type = config->cache_type;

map->cache_bypass = false;
map->cache_only = false;

ret = regcache_init(map, config);

mutex_unlock(&map->lock);
Expand Down

0 comments on commit 421e8d2

Please sign in to comment.