Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regmap: Re-introduce bulk read support check in regmap_bulk_read()

Support for drivers to define bulk read/write callbacks in regmap_config
was introduced by the commit d77e74561368 ("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: d77e74561368 ("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>

authored by

Javier Martinez Canillas and committed by
Mark Brown
ea50e2a1 f2906aa8

+1 -1
+1 -1
drivers/base/regmap/regmap.c
··· 3017 3017 if (val_count == 0) 3018 3018 return -EINVAL; 3019 3019 3020 - if (map->format.parse_inplace && (vol || map->cache_type == REGCACHE_NONE)) { 3020 + if (map->read && map->format.parse_inplace && (vol || map->cache_type == REGCACHE_NONE)) { 3021 3021 ret = regmap_raw_read(map, reg, val, val_bytes * val_count); 3022 3022 if (ret != 0) 3023 3023 return ret;