regmap: Mark the cache as clean after a successful sync
Mark Brown [Thu, 23 Feb 2012 22:05:59 +0000 (22:05 +0000)]
Previously the cache would never be marked clean, meaning syncs would
never be suppressed which isn't the end of the world but could be
inefficient.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
(cherry picked from commit 6ff7373809a9b4eb644d83e2e299da297e1cbffa)

Change-Id: I52aef73bc6bc0df10dd64da92d0bf591e44ddc0e
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/96487
Reviewed-by: Automatic_Commit_Validation_User

drivers/base/regmap/regcache.c

index 156e2a5..c38ee81 100644 (file)
@@ -287,6 +287,9 @@ int regcache_sync(struct regmap *map)
 
        ret = map->cache_ops->sync(map);
 
+       if (ret == 0)
+               map->cache_dirty = false;
+
 out:
        trace_regcache_sync(map->dev, name, "stop");
        /* Restore the bypass state */