regmap: A cache type of _NONE behaves like a bypassed cache
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 19 Sep 2011 15:08:03 +0000 (16:08 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 19 Sep 2011 18:06:36 +0000 (19:06 +0100)
Avoid extra special casing by setting the cache_bypass flag when we're
not caching.

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

index 00609bf785fb6081c77f0c7405c42685952f3cc0..179f222d76c32fd865fe53f39a6834f998a4e8c5 100644 (file)
@@ -82,8 +82,10 @@ int regcache_init(struct regmap *map)
        int i;
        void *tmp_buf;
 
-       if (map->cache_type == REGCACHE_NONE)
+       if (map->cache_type == REGCACHE_NONE) {
+               map->cache_bypass = true;
                return 0;
+       }
 
        for (i = 0; i < ARRAY_SIZE(cache_types); i++)
                if (cache_types[i]->type == map->cache_type)