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>
This commit is contained in:
Mark Brown
2011-10-09 13:23:31 +01:00
parent f094fea68f
commit 6e6ace00a0
4 changed files with 7 additions and 9 deletions

View File

@@ -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;