pinctrl: qcom: spmi-gpio: Correct power_source range check

Power source selection in DIG_VIN_CTL is indexed from 0, in the range
check it shouldn't be equal to the total number of power sources.

Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Fenglin Wu 2017-07-19 14:39:55 +08:00 committed by Linus Walleij
parent ae9d7f83a5
commit 4e83ac4cfb

View file

@ -487,7 +487,7 @@ static int pmic_gpio_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
pad->is_enabled = false;
break;
case PIN_CONFIG_POWER_SOURCE:
if (arg > pad->num_sources)
if (arg >= pad->num_sources)
return -EINVAL;
pad->power_source = arg;
break;