lkml.org 
[lkml]   [2012]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] regmap: Skip patch application when the cache is not dirty on sync
Date
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 | 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


\
 
 \ /
  Last update: 2012-01-25 22:09    [W:0.028 / U:3.952 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site