Skip to content

Commit

Permalink
regmap: Check readable regs in _regmap_read
Browse files Browse the repository at this point in the history
Check if regs are readable.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Michal Simek authored and Mark Brown committed Feb 11, 2014
1 parent 676970d commit d4807ad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d4807ad

Please sign in to comment.