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>
This commit is contained in:
Mark Brown 2011-06-20 12:25:58 +01:00 committed by Samuel Ortiz
parent ec2328c30b
commit b00cd68eb3

View file

@ -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);