dm: regmap: Fix mask in regmap_update_bits()

This function assumes that the 'val' parameter has no masked bits set.
This is not defined by the function prototype though. Fix the function to
mask the value and update the documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
This commit is contained in:
Simon Glass 2019-10-11 16:16:49 -06:00
parent 619025b8d6
commit 5ca5ec1e32
2 changed files with 3 additions and 2 deletions

View file

@ -462,5 +462,5 @@ int regmap_update_bits(struct regmap *map, uint offset, uint mask, uint val)
reg &= ~mask;
return regmap_write(map, offset, reg | val);
return regmap_write(map, offset, reg | (val & mask));
}