Skip to content

Commit 6f36f10

Browse files
andy-shevlinusw
authored andcommitted
pinctrl: cy8c95x0: Fix off-by-one in the regmap range settings
The range_max is inclusive, so we need to use the number of the last accessible register address. Fixes: 8670de9 ("pinctrl: cy8c95x0: Use regmap ranges") Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 2014c95 commit 6f36f10

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/pinctrl/pinctrl-cy8c95x0.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,15 +1438,15 @@ static int cy8c95x0_probe(struct i2c_client *client)
14381438
switch (chip->tpin) {
14391439
case 20:
14401440
strscpy(chip->name, cy8c95x0_id[0].name);
1441-
regmap_range_conf.range_max = CY8C95X0_VIRTUAL + 3 * MUXED_STRIDE;
1441+
regmap_range_conf.range_max = CY8C95X0_VIRTUAL + 3 * MUXED_STRIDE - 1;
14421442
break;
14431443
case 40:
14441444
strscpy(chip->name, cy8c95x0_id[1].name);
1445-
regmap_range_conf.range_max = CY8C95X0_VIRTUAL + 6 * MUXED_STRIDE;
1445+
regmap_range_conf.range_max = CY8C95X0_VIRTUAL + 6 * MUXED_STRIDE - 1;
14461446
break;
14471447
case 60:
14481448
strscpy(chip->name, cy8c95x0_id[2].name);
1449-
regmap_range_conf.range_max = CY8C95X0_VIRTUAL + 8 * MUXED_STRIDE;
1449+
regmap_range_conf.range_max = CY8C95X0_VIRTUAL + 8 * MUXED_STRIDE - 1;
14501450
break;
14511451
default:
14521452
return -ENODEV;

0 commit comments

Comments
 (0)