diff options
-rw-r--r-- | drivers/mfd/wm8400-core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c index 865ce013a821..e08aafa663dc 100644 --- a/drivers/mfd/wm8400-core.c +++ b/drivers/mfd/wm8400-core.c | |||
@@ -118,7 +118,7 @@ static int wm8400_read(struct wm8400 *wm8400, u8 reg, int num_regs, u16 *dest) | |||
118 | { | 118 | { |
119 | int i, ret = 0; | 119 | int i, ret = 0; |
120 | 120 | ||
121 | BUG_ON(reg + num_regs - 1 > ARRAY_SIZE(wm8400->reg_cache)); | 121 | BUG_ON(reg + num_regs > ARRAY_SIZE(wm8400->reg_cache)); |
122 | 122 | ||
123 | /* If there are any volatile reads then read back the entire block */ | 123 | /* If there are any volatile reads then read back the entire block */ |
124 | for (i = reg; i < reg + num_regs; i++) | 124 | for (i = reg; i < reg + num_regs; i++) |
@@ -144,7 +144,7 @@ static int wm8400_write(struct wm8400 *wm8400, u8 reg, int num_regs, | |||
144 | { | 144 | { |
145 | int ret, i; | 145 | int ret, i; |
146 | 146 | ||
147 | BUG_ON(reg + num_regs - 1 > ARRAY_SIZE(wm8400->reg_cache)); | 147 | BUG_ON(reg + num_regs > ARRAY_SIZE(wm8400->reg_cache)); |
148 | 148 | ||
149 | for (i = 0; i < num_regs; i++) { | 149 | for (i = 0; i < num_regs; i++) { |
150 | BUG_ON(!reg_data[reg + i].writable); | 150 | BUG_ON(!reg_data[reg + i].writable); |