Skip to content

Commit

Permalink
regmap: Ensure we scream if we enable cache bypass/only at the same time
Browse files Browse the repository at this point in the history
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 30, 2011
1 parent 6eb0f5e commit ac77a76
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/base/regmap/regcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ EXPORT_SYMBOL_GPL(regcache_sync);
void regcache_cache_only(struct regmap *map, bool enable)
{
mutex_lock(&map->lock);
WARN_ON(map->cache_bypass && enable);
map->cache_only = enable;
mutex_unlock(&map->lock);
}
Expand All @@ -300,6 +301,7 @@ EXPORT_SYMBOL_GPL(regcache_cache_only);
void regcache_cache_bypass(struct regmap *map, bool enable)
{
mutex_lock(&map->lock);
WARN_ON(map->cache_only && enable);
map->cache_bypass = enable;
mutex_unlock(&map->lock);
}
Expand Down

0 comments on commit ac77a76

Please sign in to comment.