summaryrefslogtreecommitdiff
path: root/drivers/regulator/aat2870-regulator.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/aat2870-regulator.c')
-rw-r--r--drivers/regulator/aat2870-regulator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/aat2870-regulator.c b/drivers/regulator/aat2870-regulator.c
index cd4104542f0..11d1ab4abef 100644
--- a/drivers/regulator/aat2870-regulator.c
+++ b/drivers/regulator/aat2870-regulator.c
@@ -159,7 +159,7 @@ static struct aat2870_regulator *aat2870_get_regulator(int id)
break;
}
- if (!ri)
+ if (i == ARRAY_SIZE(aat2870_regulators))
return NULL;
ri->enable_addr = AAT2870_LDO_EN;