lkml.org 
[lkml]   [2011]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 2/2] regmap: Drop check whether a register is readable in regcache_read
Date
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>

---
Changes since v1:
* Drop the check instead of replaceing it with a check whether the register
is writable since this would break once we start adding read-back values
to the cache.
---
drivers/base/regmap/regcache.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 6d93e49..e21eebd 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -199,9 +199,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);

--
1.7.7.1


\
 
 \ /
  Last update: 2011-11-16 20:37    [W:0.039 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site