From patchwork Thu Apr 9 15:18:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ivan T. Ivanov" X-Patchwork-Id: 6188641 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AD2D79F2EC for ; Thu, 9 Apr 2015 15:19:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 004DB2037B for ; Thu, 9 Apr 2015 15:19:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EB1E52035D for ; Thu, 9 Apr 2015 15:19:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755510AbbDIPSu (ORCPT ); Thu, 9 Apr 2015 11:18:50 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:35498 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755582AbbDIPSn (ORCPT ); Thu, 9 Apr 2015 11:18:43 -0400 Received: by widdi4 with SMTP id di4so96327668wid.0 for ; Thu, 09 Apr 2015 08:18:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gGOnbiNP44BnO15tAne4r4o12RotPHnXzyft6qDrEmI=; b=i/006TUUkaBEHP5FSeW3m4u8Y0OpS5fIzQ5Emg7MJeF/7ChVbUQt7u3PiFUFXvDYz8 CSt5UFdcrmFWfV1ChjElE0KQ0HyMxwlZJrZEGKFHi0X7tfd2ev1TnQsxPrRHBt84Qukj zo41SuPb2JAbOWDkpXRhSFiPyHBjtdWrfO3wvv1a6/64ep2699rMKEtAK/fCrYFIibXp +53Jbo2BA0/JB8TMZSuE9ryuUAWJz2td1n4LmmJVl7YeltSuOUEkfGGIGR3C0Zloxj6i ZBtxxrSqP52bF3YiNjzd3CDUA43/Dw0j4C1vBhak35U1Jcjt/Db+hFvBWIleajKZhoRM 5D5A== X-Gm-Message-State: ALoCoQnSQNnquzmlJiQPVj0Kz+FgkxKPJhSP16RRjH5uzWG4saOE77wL0hHcgALAlHB5v4lJgexw X-Received: by 10.180.104.34 with SMTP id gb2mr4318498wib.95.1428592722892; Thu, 09 Apr 2015 08:18:42 -0700 (PDT) Received: from localhost.localdomain ([37.157.136.206]) by mx.google.com with ESMTPSA id ed14sm10383483wic.11.2015.04.09.08.18.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Apr 2015 08:18:42 -0700 (PDT) From: "Ivan T. Ivanov" To: Linus Walleij Cc: Bjorn Andersson , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 3/3] pinctrl: qcom-spmi-mpp: Fix input value report Date: Thu, 9 Apr 2015 18:18:37 +0300 Message-Id: <1428592717-21706-3-git-send-email-ivan.ivanov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1428592717-21706-1-git-send-email-ivan.ivanov@linaro.org> References: <1428592717-21706-1-git-send-email-ivan.ivanov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix interpretation of the pmic_mpp_read() return code, negative value means an error. Signed-off-by: Ivan T. Ivanov Reviewed-by: Bjorn Andersson --- drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; } seq_printf(s, " %-4s", pad->output_enabled ? "out" : "in");