diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-01-25 16:06:33 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-01-25 16:21:56 -0500 |
commit | d9db762708e27c2892db9d8a54e735a8e506e16e (patch) | |
tree | 6c3dfa0bdb888df5f237f7b9de78c2b8a035ad91 /drivers/base/regmap/regcache.c | |
parent | 22f0d90a34827812413bb3fbeda6a2a79bb58423 (diff) |
regmap: Skip patch application when the cache is not dirty on sync
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>
Diffstat (limited to 'drivers/base/regmap/regcache.c')
-rw-r--r-- | 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 ce2034c10ffb..9c6a5c13f1da 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c | |||
@@ -269,6 +269,9 @@ int regcache_sync(struct regmap *map) | |||
269 | name = map->cache_ops->name; | 269 | name = map->cache_ops->name; |
270 | trace_regcache_sync(map->dev, name, "start"); | 270 | trace_regcache_sync(map->dev, name, "start"); |
271 | 271 | ||
272 | if (!map->cache_dirty) | ||
273 | goto out; | ||
274 | |||
272 | /* Apply any patch first */ | 275 | /* Apply any patch first */ |
273 | for (i = 0; i < map->patch_regs; i++) { | 276 | for (i = 0; i < map->patch_regs; i++) { |
274 | ret = _regmap_write(map, map->patch[i].reg, map->patch[i].def); | 277 | ret = _regmap_write(map, map->patch[i].reg, map->patch[i].def); |
@@ -279,8 +282,6 @@ int regcache_sync(struct regmap *map) | |||
279 | } | 282 | } |
280 | } | 283 | } |
281 | 284 | ||
282 | if (!map->cache_dirty) | ||
283 | goto out; | ||
284 | if (map->cache_ops->sync) { | 285 | if (map->cache_ops->sync) { |
285 | ret = map->cache_ops->sync(map); | 286 | ret = map->cache_ops->sync(map); |
286 | } else { | 287 | } else { |