From beb1a10f219ce720c13168203bd5ebe4ce7879e0 Mon Sep 17 00:00:00 2001 From: Dimitris Papastamos Date: Thu, 29 Sep 2011 14:36:26 +0100 Subject: regmap: Save/restore the bypass state upon syncing Signed-off-by: Dimitris Papastamos Signed-off-by: Mark Brown --- drivers/base/regmap/regcache.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/base/regmap') diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index 59e432c0163..5dbc5076267 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c @@ -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; @@ -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; -- cgit v1.2.3-70-g09d2