regmap: Drop check whether a register is readable in regcache_read
Lars-Peter Clausen [Wed, 16 Nov 2011 19:34:04 +0000 (20:34 +0100)]
One of the reasons for using a cache is to have a software shadow of a register
which is writable but not readable. This allows us to do a read-modify-write
operation on such a register.

Currently regcache checks whether a register is readable when performing a
cached read and returns an error if it is not. Drop this check, since it will
prevent us from using the cache for registers where read-back is not possible.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
(cherry picked from commit b44d48c1ccf70273a91b7d3a920b0b54c3cb314f)

Change-Id: Iafe9afea14b09e69f698d71bcd1dd85695cc1ad5
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/87564

drivers/base/regmap/regcache.c

index defa41d..1679d12 100644 (file)
@@ -198,9 +198,6 @@ int regcache_read(struct regmap *map,
 
        BUG_ON(!map->cache_ops);
 
-       if (!regmap_readable(map, reg))
-               return -EIO;
-
        if (!regmap_volatile(map, reg))
                return map->cache_ops->read(map, reg, value);