regmap: Mark the cache as clean after a successful sync
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 23 Feb 2012 22:05:59 +0000 (22:05 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 23 Feb 2012 22:07:19 +0000 (22:07 +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>
drivers/base/regmap/regcache.c

index 4d43ed3..46c42d3 100644 (file)
@@ -285,6 +285,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 */