]> git.karo-electronics.de Git - linux-beck.git/commitdiff
regmap: Skip patch application when the cache is not dirty on sync
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 25 Jan 2012 21:06:33 +0000 (21:06 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 25 Jan 2012 21:21:56 +0000 (21:21 +0000)
On the basis that if we don't actually need to resync the cache then the
patches are probably also already applied.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/base/regmap/regcache.c

index ce2034c10ffb94d55b31bf0cd83379a44acc82d8..9c6a5c13f1daca7c1203a5a1b7e31e7fa98af181 100644 (file)
@@ -269,6 +269,9 @@ int regcache_sync(struct regmap *map)
        name = map->cache_ops->name;
        trace_regcache_sync(map->dev, name, "start");
 
+       if (!map->cache_dirty)
+               goto out;
+
        /* Apply any patch first */
        for (i = 0; i < map->patch_regs; i++) {
                ret = _regmap_write(map, map->patch[i].reg, map->patch[i].def);
@@ -279,8 +282,6 @@ int regcache_sync(struct regmap *map)
                }
        }
 
-       if (!map->cache_dirty)
-               goto out;
        if (map->cache_ops->sync) {
                ret = map->cache_ops->sync(map);
        } else {