Skip to content

Commit

Permalink
regmap: Modify map->cache_bypass directly
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dimitris Papastamos authored and Mark Brown committed Sep 28, 2011
1 parent a40c282 commit ec8a365
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/base/regmap/regcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit ec8a365

Please sign in to comment.