summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2014-02-10 12:59:46 +0100
committerMark Brown <broonie@linaro.org>2014-02-11 16:38:47 +0000
commitd4807ad2c4c0e17b6f00e3be9492c81de0804f40 (patch)
tree83294f468f801639c811e08024296b323070186f /drivers/base
parent676970da5cf6fec096945a8bbc19749089af57aa (diff)
regmap: Check readable regs in _regmap_read
Check if regs are readable. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/regmap/regmap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 6a19515f8a45..b897c1a88b56 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1736,6 +1736,9 @@ static int _regmap_read(struct regmap *map, unsigned int reg,
if (map->cache_only)
return -EBUSY;
+ if (!regmap_readable(map, reg))
+ return -EIO;
+
ret = map->reg_read(context, reg, val);
if (ret == 0) {
#ifdef LOG_DEVICE