Skip to content

Commit

Permalink
regmap: Re-introduce bulk read support check in regmap_bulk_read()
Browse files Browse the repository at this point in the history
Support for drivers to define bulk read/write callbacks in regmap_config
was introduced by the commit d77e745 ("regmap: Add bulk read/write
callbacks into regmap_config"), but this commit wrongly dropped a check
in regmap_bulk_read() to determine whether bulk reads can be done or not.

Before that commit, it was checked if map->bus was set. Now has to check
if a map->read callback has been set.

Fixes: d77e745 ("regmap: Add bulk read/write callbacks into regmap_config")
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20220616073435.1988219-2-javierm@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Javier Martinez Canillas authored and Mark Brown committed Jun 20, 2022
1 parent f2906aa commit ea50e2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3017,7 +3017,7 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
if (val_count == 0)
return -EINVAL;

if (map->format.parse_inplace && (vol || map->cache_type == REGCACHE_NONE)) {
if (map->read && map->format.parse_inplace && (vol || map->cache_type == REGCACHE_NONE)) {
ret = regmap_raw_read(map, reg, val, val_bytes * val_count);
if (ret != 0)
return ret;
Expand Down

0 comments on commit ea50e2a

Please sign in to comment.