Skip to content

Commit 2a16692

Browse files
martinezjavierbroonie
authored andcommitted
regmap: Wire up regmap_config provided bulk write in missed functions
There are some functions that were missed by commit d77e745 ("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: d77e745 ("regmap: Add bulk read/write callbacks into regmap_config") Signed-off-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Marek Vasut <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c42e99a commit 2a16692

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/base/regmap/regmap.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1880,8 +1880,7 @@ static int _regmap_raw_write_impl(struct regmap *map, unsigned int reg,
18801880
*/
18811881
bool regmap_can_raw_write(struct regmap *map)
18821882
{
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;
18851884
}
18861885
EXPORT_SYMBOL_GPL(regmap_can_raw_write);
18871886

@@ -2155,10 +2154,9 @@ int regmap_noinc_write(struct regmap *map, unsigned int reg,
21552154
size_t write_len;
21562155
int ret;
21572156

2158-
if (!map->bus)
2159-
return -EINVAL;
2160-
if (!map->bus->write)
2157+
if (!map->write)
21612158
return -ENOTSUPP;
2159+
21622160
if (val_len % map->format.val_bytes)
21632161
return -EINVAL;
21642162
if (!IS_ALIGNED(reg, map->reg_stride))
@@ -2278,7 +2276,7 @@ int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val,
22782276
* Some devices don't support bulk write, for them we have a series of
22792277
* single write operations.
22802278
*/
2281-
if (!map->bus || !map->format.parse_inplace) {
2279+
if (!map->write || !map->format.parse_inplace) {
22822280
map->lock(map->lock_arg);
22832281
for (i = 0; i < val_count; i++) {
22842282
unsigned int ival;

0 commit comments

Comments
 (0)