aboutsummaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/max8998.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/regulator/max8998.c b/drivers/regulator/max8998.c
index 03e55a18a2a..ab67298799f 100644
--- a/drivers/regulator/max8998.c
+++ b/drivers/regulator/max8998.c
@@ -119,7 +119,7 @@ static int max8998_list_voltage(struct regulator_dev *rdev,
int ldo = max8998_get_ldo(rdev);
int val;
- if (ldo > ARRAY_SIZE(ldo_voltage_map))
+ if (ldo >= ARRAY_SIZE(ldo_voltage_map))
return -EINVAL;
desc = ldo_voltage_map[ldo];
@@ -306,7 +306,7 @@ static int max8998_set_voltage(struct regulator_dev *rdev,
u8 val;
bool en_ramp = false;
- if (ldo > ARRAY_SIZE(ldo_voltage_map))
+ if (ldo >= ARRAY_SIZE(ldo_voltage_map))
return -EINVAL;
desc = ldo_voltage_map[ldo];