Skip to content

Commit

Permalink
regmap: Save/restore the bypass state upon syncing
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Dimitris Papastamos authored and Mark Brown committed Sep 30, 2011
1 parent 13753a9 commit beb1a10
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/base/regmap/regcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,13 @@ int regcache_sync(struct regmap *map)
unsigned int val;
unsigned int i;
const char *name;
unsigned int bypass;

BUG_ON(!map->cache_ops);

mutex_lock(&map->lock);
/* Remember the initial bypass state */
bypass = map->cache_bypass;
dev_dbg(map->dev, "Syncing %s cache\n",
map->cache_ops->name);
name = map->cache_ops->name;
Expand All @@ -255,6 +258,8 @@ int regcache_sync(struct regmap *map)
}
out:
trace_regcache_sync(map->dev, name, "stop");
/* Restore the bypass state */
map->cache_bypass = bypass;
mutex_unlock(&map->lock);

return ret;
Expand Down

0 comments on commit beb1a10

Please sign in to comment.