From b00cd68eb3f6c81525e43f6259b65665ef32499a Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 20 Jun 2011 12:25:58 +0100 Subject: mfd: Ensure value written by wm831x_set_bits() is within the mask Purely for defensiveness. Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz --- drivers/mfd/wm831x-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/mfd/wm831x-core.c') 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); -- cgit v1.2.3