diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-10-09 14:23:31 +0200 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-10-10 11:24:03 +0200 |
commit | 6e6ace00a045251bd172b9b9c2379857bbff3dc7 (patch) | |
tree | 63a4d6686b3955ca16e7727883445209de67074b /drivers/base/regmap/regcache-rbtree.c | |
parent | regmap: Use bsearch() to search the register defaults (diff) | |
download | linux-6e6ace00a045251bd172b9b9c2379857bbff3dc7.tar.xz linux-6e6ace00a045251bd172b9b9c2379857bbff3dc7.zip |
regmap: Return a sensible error code if we fail to read the cache
If a register isn't cached then let callers know that so they can fall
back or error handle appropriately.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base/regmap/regcache-rbtree.c')
-rw-r--r-- | drivers/base/regmap/regcache-rbtree.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c index 40f23dd8478c..887dbce63aff 100644 --- a/drivers/base/regmap/regcache-rbtree.c +++ b/drivers/base/regmap/regcache-rbtree.c @@ -193,8 +193,7 @@ static int regcache_rbtree_read(struct regmap *map, *value = regcache_rbtree_get_register(rbnode, reg_tmp, map->cache_word_size); } else { - /* uninitialized registers default to 0 */ - *value = 0; + return -ENOENT; } return 0; |