Commit b00cd68e authored by Mark Brown's avatar Mark Brown Committed by Samuel Ortiz

mfd: Ensure value written by wm831x_set_bits() is within the mask

Purely for defensiveness.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent ec2328c3
...@@ -295,7 +295,7 @@ int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg, ...@@ -295,7 +295,7 @@ int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg,
goto out; goto out;
r &= ~mask; r &= ~mask;
r |= val; r |= val & mask;
ret = wm831x_write(wm831x, reg, 2, &r); ret = wm831x_write(wm831x, reg, 2, &r);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment