Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933287AbbDIQEG (ORCPT ); Thu, 9 Apr 2015 12:04:06 -0400 Received: from seldrel01.sonyericsson.com ([212.209.106.2]:12380 "EHLO seldrel01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932708AbbDIQEB (ORCPT ); Thu, 9 Apr 2015 12:04:01 -0400 Date: Thu, 9 Apr 2015 09:03:55 -0700 From: Bjorn Andersson To: "Ivan T. Ivanov" CC: Linus Walleij , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-msm@vger.kernel.org" Subject: Re: [PATCH 3/3] pinctrl: qcom-spmi-mpp: Fix input value report Message-ID: <20150409160355.GI19186@sonymobile.com> References: <1428592717-21706-1-git-send-email-ivan.ivanov@linaro.org> <1428592717-21706-3-git-send-email-ivan.ivanov@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1428592717-21706-3-git-send-email-ivan.ivanov@linaro.org> User-Agent: Mutt/1.5.22 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1291 Lines: 39 On Thu 09 Apr 08:18 PDT 2015, Ivan T. Ivanov wrote: > Fix interpretation of the pmic_mpp_read() return code, > negative value means an error. > > Signed-off-by: Ivan T. Ivanov > --- > drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c > index 8f36c5f..8f6c7be 100644 > --- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c > +++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c > @@ -576,10 +576,11 @@ static void pmic_mpp_config_dbg_show(struct pinctrl_dev *pctldev, > > if (pad->input_enabled) { > ret = pmic_mpp_read(state, pad, PMIC_MPP_REG_RT_STS); > - if (!ret) { > - ret &= PMIC_MPP_REG_RT_STS_VAL_MASK; > - pad->out_value = ret; > - } > + if (ret < 0) > + return; > + > + ret &= PMIC_MPP_REG_RT_STS_VAL_MASK; > + pad->out_value = ret; Same as with the gpio driver. Reviewed-by: Bjorn Andersson Regards, Bjrn -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/