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

regmap: Wire up regmap_config provided bulk write in missed functions

There are some functions that were missed by commit d77e74561368 ("regmap:
Add bulk read/write callbacks into regmap_config") when support to define
bulk read/write callbacks in regmap_config was introduced.

The regmap_bulk_write() and regmap_noinc_write() functions weren't changed
to use the added map->write instead of the map->bus->write handler.

Also, the regmap_can_raw_write() was not modified to take map->write into
account. So will only return true if a bus with a .write callback is 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-4-javierm@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Javier Martinez Canillas and committed by
Mark Brown
2a166929 c42e99a3

+4 -6
+4 -6
drivers/base/regmap/regmap.c
··· 1880 1880 */ 1881 1881 bool regmap_can_raw_write(struct regmap *map) 1882 1882 { 1883 - return map->bus && map->bus->write && map->format.format_val && 1884 - map->format.format_reg; 1883 + return map->write && map->format.format_val && map->format.format_reg; 1885 1884 } 1886 1885 EXPORT_SYMBOL_GPL(regmap_can_raw_write); 1887 1886 ··· 2154 2155 size_t write_len; 2155 2156 int ret; 2156 2157 2157 - if (!map->bus) 2158 - return -EINVAL; 2159 - if (!map->bus->write) 2158 + if (!map->write) 2160 2159 return -ENOTSUPP; 2160 + 2161 2161 if (val_len % map->format.val_bytes) 2162 2162 return -EINVAL; 2163 2163 if (!IS_ALIGNED(reg, map->reg_stride)) ··· 2276 2278 * Some devices don't support bulk write, for them we have a series of 2277 2279 * single write operations. 2278 2280 */ 2279 - if (!map->bus || !map->format.parse_inplace) { 2281 + if (!map->write || !map->format.parse_inplace) { 2280 2282 map->lock(map->lock_arg); 2281 2283 for (i = 0; i < val_count; i++) { 2282 2284 unsigned int ival;