summaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-06-20 12:25:58 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2011-07-31 23:28:23 +0200
commitb00cd68eb3f6c81525e43f6259b65665ef32499a (patch)
treed539d238eef08fd2c9f974565bc650929d90e6d8 /drivers/mfd
parentec2328c30bf09fe31e77889090eeb1a965325f53 (diff)
downloadlinux-b00cd68eb3f6c81525e43f6259b65665ef32499a.tar.bz2
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.c2
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,
goto out;
r &= ~mask;
- r |= val;
+ r |= val & mask;
ret = wm831x_write(wm831x, reg, 2, &r);