diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-06-20 11:25:58 (GMT) |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-07-31 21:28:23 (GMT) |
commit | b00cd68eb3f6c81525e43f6259b65665ef32499a (patch) | |
tree | d539d238eef08fd2c9f974565bc650929d90e6d8 /drivers | |
parent | ec2328c30bf09fe31e77889090eeb1a965325f53 (diff) | |
download | linux-b00cd68eb3f6c81525e43f6259b65665ef32499a.tar.xz |
mfd: Ensure value written by wm831x_set_bits() is within the mask
Purely for defensiveness.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mfd/wm831x-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c index 772fe58..baae9e4 100644 --- a/drivers/mfd/wm831x-core.c +++ b/drivers/mfd/wm831x-core.c @@ -295,7 +295,7 @@ int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg, goto out; r &= ~mask; - r |= val; + r |= val & mask; ret = wm831x_write(wm831x, reg, 2, &r); |