[PATCH 2/2] regmap: Skip patch application when the cache is not dirty on sync

From: Mark Brown
Date: Wed Jan 25 2012 - 16:07:44 EST


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@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
---
drivers/base/regmap/regcache.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index bfe48e4..d103401 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -267,6 +267,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 */
map->cache_bypass = 1;
for (i = 0; i < map->patch_regs; i++) {
@@ -279,8 +282,6 @@ int regcache_sync(struct regmap *map)
}
map->cache_bypass = 0;

- if (!map->cache_dirty)
- goto out;
if (map->cache_ops->sync) {
ret = map->cache_ops->sync(map);
} else {
--
1.7.9.rc1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/