Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751191AbdHXFDd (ORCPT ); Thu, 24 Aug 2017 01:03:33 -0400 Received: from mail-pg0-f47.google.com ([74.125.83.47]:37217 "EHLO mail-pg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751019AbdHXFDa (ORCPT ); Thu, 24 Aug 2017 01:03:30 -0400 Date: Wed, 23 Aug 2017 22:03:26 -0700 From: Bjorn Andersson To: fenglinw@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij , linux-gpio@vger.kernel.org, collinsd@codeaurora.org, aghayal@codeaurora.org, wruan@codeaurora.org, kgunda@codeaurora.org Subject: Re: [PATCH V1] pinctrl: qcom: spmi-gpio: Correct power_source range check Message-ID: <20170824050326.GD29306@minitux> References: <20170719064121.13948-1-fenglinw@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170719064121.13948-1-fenglinw@codeaurora.org> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1160 Lines: 35 On Tue 18 Jul 23:39 PDT 2017, fenglinw@codeaurora.org wrote: > From: Fenglin Wu > > 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. > Acked-by: Bjorn Andersson Regards, Bjorn > Signed-off-by: Fenglin Wu > --- > drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c > index 664b641..8b77c04 100644 > --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c > +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c > @@ -375,7 +375,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; > -- > Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project. >