summaryrefslogtreecommitdiff
path: root/drivers/base/regmap/regcache-indexed.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/regmap/regcache-indexed.c')
-rw-r--r--drivers/base/regmap/regcache-indexed.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/base/regmap/regcache-indexed.c b/drivers/base/regmap/regcache-indexed.c
index 2e10bb13bfc4..507731ad8ec1 100644
--- a/drivers/base/regmap/regcache-indexed.c
+++ b/drivers/base/regmap/regcache-indexed.c
@@ -20,11 +20,10 @@ static int regcache_indexed_read(struct regmap *map, unsigned int reg,
int ret;
ret = regcache_lookup_reg(map, reg);
- if (ret < 0)
- *value = 0;
- else
+ if (ret >= 0)
*value = map->reg_defaults[ret].def;
- return 0;
+
+ return ret;
}
static int regcache_indexed_write(struct regmap *map, unsigned int reg,