Commit d4807ad2 authored by Michal Simek's avatar Michal Simek Committed by Mark Brown

regmap: Check readable regs in _regmap_read

Check if regs are readable.
Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 676970da
...@@ -1736,6 +1736,9 @@ static int _regmap_read(struct regmap *map, unsigned int reg, ...@@ -1736,6 +1736,9 @@ static int _regmap_read(struct regmap *map, unsigned int reg,
if (map->cache_only) if (map->cache_only)
return -EBUSY; return -EBUSY;
if (!regmap_readable(map, reg))
return -EIO;
ret = map->reg_read(context, reg, val); ret = map->reg_read(context, reg, val);
if (ret == 0) { if (ret == 0) {
#ifdef LOG_DEVICE #ifdef LOG_DEVICE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment