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.

Change-Id: Ic9666576d191e9dd0e267e96d5b4fc5a97c5b077
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
This commit is contained in:
Fenglin Wu 2016-08-18 11:41:03 +08:00
parent 1d96044241
commit 76b2bf4f1a

View file

@ -505,7 +505,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;