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: 46966 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1C94D21416 for ; Thu, 9 Apr 2015 15:19:31 +0000 (UTC) Received: by wgtl5 with SMTP id l5sf13028862wgt.1 for ; Thu, 09 Apr 2015 08:19:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=ZaoVDsHTW/rGpTjCcLLNX7XcRK9SjGCVE8NsO7QeQyA=; b=bb/2a5Y6mtf8wGpj6zVJqSre1cjUoZBpihOoc1Cyb5JxFVAdNyJPHC8REFu2oYLyrM 9jz/JKqj5YnMcSoLZcmqXoXf8u0BNCAXR7LWgNZxVIg7PHGfNyNF9Fbmbri6wYxFC0Ic TEPXuFsom3qxBYt6rfky8veV+uHUC1YFewfRvTbPa+BT6bEKCE4gGTJFiL8Pq1BgPnZd k7DTnKHkQ+o3f9fbTvWT8garmp0sS3w84YE/bnzpYMw+HTzjEIwTfyiKWVdzM+2qoknD eWwniuP2I87w+ONAxeLOtMVHXONlT8ztGTR/snxgEhQcYim0lgH7MPWPxlel+9mA8qVQ R0Cg== X-Gm-Message-State: ALoCoQlePRvbTLHgWFeEtGan03Pkd7jsHg4KWgVD3F7KCn1zWLiruq5dFqJ0FUY7KbeH9kx9J39K X-Received: by 10.194.161.194 with SMTP id xu2mr6054592wjb.1.1428592770369; Thu, 09 Apr 2015 08:19:30 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.72 with SMTP id b8ls337013laf.81.gmail; Thu, 09 Apr 2015 08:19:30 -0700 (PDT) X-Received: by 10.112.118.73 with SMTP id kk9mr6679083lbb.3.1428592770079; Thu, 09 Apr 2015 08:19:30 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id w8si11680455law.99.2015.04.09.08.19.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Apr 2015 08:19:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbcga7 with SMTP id ga7so44077671lbc.1 for ; Thu, 09 Apr 2015 08:19:30 -0700 (PDT) X-Received: by 10.112.29.36 with SMTP id g4mr29289777lbh.56.1428592769928; Thu, 09 Apr 2015 08:19:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp535942lbt; Thu, 9 Apr 2015 08:19:29 -0700 (PDT) X-Received: by 10.66.166.39 with SMTP id zd7mr58009892pab.117.1428592768046; Thu, 09 Apr 2015 08:19:28 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oz3si2489221pac.22.2015.04.09.08.19.27; Thu, 09 Apr 2015 08:19:28 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755717AbbDIPSv (ORCPT + 27 others); Thu, 9 Apr 2015 11:18:51 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:36478 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755521AbbDIPSn (ORCPT ); Thu, 9 Apr 2015 11:18:43 -0400 Received: by wizk4 with SMTP id k4so96436396wiz.1 for ; Thu, 09 Apr 2015 08:18:42 -0700 (PDT) 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-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ivan.ivanov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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(-) -- 1.9.1 -- 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/ 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");