From: Michal Simek Date: Mon, 10 Feb 2014 11:59:46 +0000 (+0100) Subject: regmap: Check readable regs in _regmap_read X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d4807ad2c4c0e17b6f00e3be9492c81de0804f40;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git regmap: Check readable regs in _regmap_read Check if regs are readable. Signed-off-by: Michal Simek Signed-off-by: Mark Brown --- 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