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:
parent
1d96044241
commit
76b2bf4f1a
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue