regulator: pm8xxx-regulator: Fix regulator type bound check

Fix an off-by-one error in the pm8xxx-regulator probe function
which allows regulators configured with an incorrect type to
probe successfully.

Change-Id: I013abbd7098735863e96ac5c8eb69329ea93d136
Signed-off-by: David Collins <collinsd@codeaurora.org>
diff --git a/drivers/regulator/pm8xxx-regulator.c b/drivers/regulator/pm8xxx-regulator.c
index fa17449..fd691f0 100644
--- a/drivers/regulator/pm8xxx-regulator.c
+++ b/drivers/regulator/pm8xxx-regulator.c
@@ -3105,7 +3105,7 @@
 	if (vreg->rdesc.name == NULL) {
 		pr_err("regulator name missing\n");
 		return -EINVAL;
-	} else if (vreg->type < 0 || vreg->type > PM8XXX_REGULATOR_TYPE_MAX) {
+	} else if (vreg->type < 0 || vreg->type >= PM8XXX_REGULATOR_TYPE_MAX) {
 		pr_err("%s: regulator type=%d is invalid\n", vreg->rdesc.name,
 			vreg->type);
 		return -EINVAL;