regmap: Grab the lock in regcache_cache_only()
authorDimitris Papastamos <dp@opensource.wolfsonmicro.com>
Wed, 28 Sep 2011 10:43:45 +0000 (11:43 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 28 Sep 2011 12:57:36 +0000 (13:57 +0100)
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/base/regmap/regcache.c

index f46e247..744ed14 100644 (file)
@@ -273,7 +273,9 @@ EXPORT_SYMBOL_GPL(regcache_sync);
  */
 void regcache_cache_only(struct regmap *map, bool enable)
 {
+       mutex_lock(&map->sync_lock);
        map->cache_only = enable;
+       mutex_unlock(&map->sync_lock);
 }
 EXPORT_SYMBOL_GPL(regcache_cache_only);