aboutsummaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-10-11 16:16:49 -0600
committerSimon Glass <sjg@chromium.org>2019-10-27 10:56:41 -0600
commit5ca5ec1e3272f40a7ad26a15e3df3bb18e0b11d8 (patch)
tree54e34ae436bfdfa1839639579a9acb2ebad5b0e9 /drivers/core
parent619025b8d68b346442430b8a412852b63960bedb (diff)
downloadu-boot-5ca5ec1e3272f40a7ad26a15e3df3bb18e0b11d8.zip
u-boot-5ca5ec1e3272f40a7ad26a15e3df3bb18e0b11d8.tar.gz
u-boot-5ca5ec1e3272f40a7ad26a15e3df3bb18e0b11d8.tar.bz2
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>
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/regmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/core/regmap.c b/drivers/core/regmap.c
index d1d12ee..e9e55c9 100644
--- a/drivers/core/regmap.c
+++ b/drivers/core/regmap.c
@@ -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));
}