diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2013-12-13 17:14:07 (GMT) |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-12-16 20:54:35 (GMT) |
commit | 3b58ee13da7510115b66f71c67c9e87b47e9c4aa (patch) | |
tree | 96cadc0cf8c2152e53e92942ec32233696d28688 /drivers/base | |
parent | bd60e381fab88979c3312265d18bb635c314d242 (diff) | |
download | linux-3b58ee13da7510115b66f71c67c9e87b47e9c4aa.tar.xz |
regmap: Allow regmap_bulk_read() to work for "no-bus" regmaps
regmap_bulk_read() should decay to performing individual reads if
we're using a "no-bus" regmap. Unfortunately, it returns an
error because there is no map->bus pointer. Fix it.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/regmap/regmap.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 9a36ac1..02fa0e4 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -1897,14 +1897,10 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val, size_t val_bytes = map->format.val_bytes; bool vol = regmap_volatile_range(map, reg, val_count); - if (!map->bus) - return -EINVAL; - if (!map->format.parse_inplace) - return -EINVAL; if (reg % map->reg_stride) return -EINVAL; - if (vol || map->cache_type == REGCACHE_NONE) { + if (map->bus && map->format.parse_inplace && (vol || map->cache_type == REGCACHE_NONE)) { /* * Some devices does not support bulk read, for * them we have a series of single read operations. |