regmap: Modify map->cache_bypass directly
authorDimitris Papastamos <dp@opensource.wolfsonmicro.com>
Wed, 28 Sep 2011 10:43:42 +0000 (11:43 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 28 Sep 2011 12:56:39 +0000 (13:56 +0100)
In preperation for the upcoming patches, modify map->cache_bypass
directly.  The helper functions will grab an exclusive lock.  Because
we'll have acquired the same lock we need to avoid a deadlock.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/base/regmap/regcache.c

index 5364dde2ecd05e28c18cb6a13ecae9c558c924ae..f46e247912cbe76b81b1181e80ba8c5e687b9c14 100644 (file)
@@ -241,9 +241,9 @@ int regcache_sync(struct regmap *map)
                        ret = regcache_read(map, i, &val);
                        if (ret < 0)
                                goto out;
-                       regcache_cache_bypass(map, true);
+                       map->cache_bypass = 1;
                        ret = regmap_write(map, i, val);
-                       regcache_cache_bypass(map, false);
+                       map->cache_bypass = 0;
                        if (ret < 0)
                                goto out;
                        dev_dbg(map->dev, "Synced register %#x, value %#x\n",