summaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap/regcache.c
diff options
context:
space:
mode:
authorDimitris Papastamos <dp@opensource.wolfsonmicro.com>2011-09-29 14:36:25 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-09-30 13:57:47 +0100
commit13753a9088af23c61e2f5c10a8f3ea136d8ebab5 (patch)
tree44c7a109f98995800f55ffd8b0cf0cefca158caf /drivers/base/regmap/regcache.c
parent5fcd2560767cead8f0c741340e132c5417d9f73b (diff)
downloadblackbird-op-linux-13753a9088af23c61e2f5c10a8f3ea136d8ebab5.tar.gz
blackbird-op-linux-13753a9088af23c61e2f5c10a8f3ea136d8ebab5.zip
regmap: Lock the sync path, ensure we use the lockless _regmap_write()
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base/regmap/regcache.c')
-rw-r--r--drivers/base/regmap/regcache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 2caf6e49c389..59e432c0163d 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -230,6 +230,7 @@ int regcache_sync(struct regmap *map)
BUG_ON(!map->cache_ops);
+ mutex_lock(&map->lock);
dev_dbg(map->dev, "Syncing %s cache\n",
map->cache_ops->name);
name = map->cache_ops->name;
@@ -242,7 +243,7 @@ int regcache_sync(struct regmap *map)
if (ret < 0)
goto out;
map->cache_bypass = 1;
- ret = regmap_write(map, i, val);
+ ret = _regmap_write(map, i, val);
map->cache_bypass = 0;
if (ret < 0)
goto out;
@@ -254,6 +255,7 @@ int regcache_sync(struct regmap *map)
}
out:
trace_regcache_sync(map->dev, name, "stop");
+ mutex_unlock(&map->lock);
return ret;
}
OpenPOWER on IntegriCloud