diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-06-20 07:25:58 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-07-31 17:28:23 -0400 |
commit | b00cd68eb3f6c81525e43f6259b65665ef32499a (patch) | |
tree | d539d238eef08fd2c9f974565bc650929d90e6d8 /drivers/mfd | |
parent | ec2328c30bf09fe31e77889090eeb1a965325f53 (diff) |
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/mfd')
-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 772fe584f3b8..baae9e47bffb 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, | |||
295 | goto out; | 295 | goto out; |
296 | 296 | ||
297 | r &= ~mask; | 297 | r &= ~mask; |
298 | r |= val; | 298 | r |= val & mask; |
299 | 299 | ||
300 | ret = wm831x_write(wm831x, reg, 2, &r); | 300 | ret = wm831x_write(wm831x, reg, 2, &r); |
301 | 301 | ||