regmap: Track if the register cache is dirty and suppress unneeded syncs
[linux-2.6.git] / drivers / base / regmap / regmap.c
index b9badfe..e527b0c 100644 (file)
@@ -306,8 +306,10 @@ int _regmap_write(struct regmap *map, unsigned int reg,
                ret = regcache_write(map, reg, val);
                if (ret != 0)
                        return ret;
-               if (map->cache_only)
+               if (map->cache_only) {
+                       map->cache_dirty = true;
                        return 0;
+               }
        }
 
        trace_regmap_reg_write(map->dev, reg, val);