提交 9a16ea90 编写于 作者: M Markus Pargmann 提交者: Mark Brown

regmap: regmap_raw_read return error on !bus->read

Return -ENOTSUPP if map->bus->read is not implemented and we do not use
the cache. This code path would directly use bus->read would run into an
NULL pointer for the read function.
Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 bc0195aa
......@@ -2184,6 +2184,11 @@ int regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
if (regmap_volatile_range(map, reg, val_count) || map->cache_bypass ||
map->cache_type == REGCACHE_NONE) {
if (!map->bus->read) {
ret = -ENOTSUPP;
goto out;
}
/* Physical block read if there's no cache involved */
ret = _regmap_raw_read(map, reg, val, val_len);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册