diff options
author | Dimitris Papastamos <dp@opensource.wolfsonmicro.com> | 2011-09-29 09:36:25 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-09-30 08:57:47 -0400 |
commit | 13753a9088af23c61e2f5c10a8f3ea136d8ebab5 (patch) | |
tree | 44c7a109f98995800f55ffd8b0cf0cefca158caf /drivers/base/regmap/regcache.c | |
parent | 5fcd2560767cead8f0c741340e132c5417d9f73b (diff) |
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.c | 4 |
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) | |||
230 | 230 | ||
231 | BUG_ON(!map->cache_ops); | 231 | BUG_ON(!map->cache_ops); |
232 | 232 | ||
233 | mutex_lock(&map->lock); | ||
233 | dev_dbg(map->dev, "Syncing %s cache\n", | 234 | dev_dbg(map->dev, "Syncing %s cache\n", |
234 | map->cache_ops->name); | 235 | map->cache_ops->name); |
235 | name = map->cache_ops->name; | 236 | name = map->cache_ops->name; |
@@ -242,7 +243,7 @@ int regcache_sync(struct regmap *map) | |||
242 | if (ret < 0) | 243 | if (ret < 0) |
243 | goto out; | 244 | goto out; |
244 | map->cache_bypass = 1; | 245 | map->cache_bypass = 1; |
245 | ret = regmap_write(map, i, val); | 246 | ret = _regmap_write(map, i, val); |
246 | map->cache_bypass = 0; | 247 | map->cache_bypass = 0; |
247 | if (ret < 0) | 248 | if (ret < 0) |
248 | goto out; | 249 | goto out; |
@@ -254,6 +255,7 @@ int regcache_sync(struct regmap *map) | |||
254 | } | 255 | } |
255 | out: | 256 | out: |
256 | trace_regcache_sync(map->dev, name, "stop"); | 257 | trace_regcache_sync(map->dev, name, "stop"); |
258 | mutex_unlock(&map->lock); | ||
257 | 259 | ||
258 | return ret; | 260 | return ret; |
259 | } | 261 | } |