regmap: Warn on raw I/O as well as bulk reads that bypass cache
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 9 Oct 2011 12:35:43 +0000 (13:35 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 10 Oct 2011 09:24:33 +0000 (10:24 +0100)
As with the bulk reads we really should be able to make these play
nicely with the cache but warn for now.

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

index d786ddcaf1173a88fdbb29c52744cc4937b8a898..85bffddda530c082120405172c516fabb5e69fad 100644 (file)
@@ -377,6 +377,8 @@ int regmap_raw_write(struct regmap *map, unsigned int reg,
 {
        int ret;
 
+       WARN_ON(map->cache_type != REGCACHE_NONE);
+
        mutex_lock(&map->lock);
 
        ret = _regmap_raw_write(map, reg, val, val_len);
@@ -481,6 +483,8 @@ int regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
 {
        int ret;
 
+       WARN_ON(map->cache_type != REGCACHE_NONE);
+
        mutex_lock(&map->lock);
 
        ret = _regmap_raw_read(map, reg, val, val_len);