From patchwork Fri Sep 9 09:26:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101823 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp246917qgf; Fri, 9 Sep 2016 02:27:28 -0700 (PDT) X-Received: by 10.98.145.18 with SMTP id l18mr4775737pfe.18.1473413247035; Fri, 09 Sep 2016 02:27:27 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y2si3113189pfg.99.2016.09.09.02.27.26; Fri, 09 Sep 2016 02:27:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750892AbcIIJ10 (ORCPT + 4 others); Fri, 9 Sep 2016 05:27:26 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:64572 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751091AbcIIJ1Z (ORCPT ); Fri, 9 Sep 2016 05:27:25 -0400 Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue001) with ESMTPA (Nemesis) id 0M3rPO-1aqsUR2qjS-00rZSV; Fri, 09 Sep 2016 11:27:17 +0200 From: Arnd Bergmann To: Linus Walleij Cc: Arnd Bergmann , Andrew Jeffery , Joel Stanley , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] pinctrl: aspeed: fix regmap error handling Date: Fri, 9 Sep 2016 11:26:50 +0200 Message-Id: <20160909092715.403663-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:0WISEPJmVyVLUcgkqb9xLLGK8XrkMlQitcOf/hB99C/pCYqo30X 5yEEUeu56S/EpIVzJihKaeX4Ysd6RoE2KHMHHlgNTykMIyNs00WzLV6dI7Kx/mUCL3TkPRr KUEEdBsxPtugCOOtjVe2+ozmknOqEkksbH5js8mamRtUUEiWuX8DATvRyjLaT1e+txB1SjE zsGGMGYx3TP2gVBvhYyAw== X-UI-Out-Filterresults: notjunk:1; V01:K0:c3r3N1Yqjzg=:1XwrauUJUUDiVQ/mymYiFN duLTp06w18uwiN/8LlCV14sBm7Kwq6AIkQZTXTnHMlMI+FYEMPrzRNXPs6mxckNuIFBDp0c1g cYTDOEqniITSpeHWbNcZgz//vvawEllP4ms0pudkjSwjiokme0bdvCKdbwjrXuybA/8lP+mQS ISZ9JbEfDO0EWPMR9gJaC+IrVwLFaN3Bcyp9+Rd2FS54hKMrnNSiqjgWrhfWonQGJNwxgc4Kp B1rYIm0m7CkZiZ232Lnrw/g2E7jj5Rby1kKe9EUUDCnoVG0mbYnrVMd14C3LXQHKJ6+aQ6mwN gWntV9p7MLs+wFYpQm9V1g2V+1+sFgIlKA2yLQ0yuJpfYPv//3hPRsRqVzNJNgSZEIyiY0XIG dV2zOPBv8S470ibIyRdpmklv0sd4MO1LkviSRcbZdJW9M+GtBucFL6HgdJUwwRomPyxpcQav0 Ga/dABInCuwjIIXoGoFy2CfwIdZaELQta8LFJ8v0558WOm0864IrAA/3MBfQ/3KSoj6YkCR5B 67sW1+ZyWfN0kwH8mpMB+amy3A7F5WN9+ok8QP0HJDXdpR7ZwZGRVEsYVZjLx3DWOy77hgm2F laxzD8IEc1YdFJgcfJf3NhHOBntMhELy4gb31itzInNY9Ly2eeLdgcm1SHK8CAiFcAO/cJ9EL zSgXZ1CnS/Aal6HfU4QDo5ju0bqlothQ10ZMcbjkNoTgg6tnRoDTyZrKcpM2+N125E78= Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The newly added aspeed driver tries to check for a negative return value from a pinctrl function, but stores the intermediate value in a 'bool' variable, which cannot work: drivers/pinctrl/aspeed/pinctrl-aspeed.c: In function 'aspeed_sig_expr_set': drivers/pinctrl/aspeed/pinctrl-aspeed.c:192:11: error: comparison of constant '0' with boolean expression is always false [-Werror=bool-compare] This slightly reworks the logic to use an explicit comparison with zero before assigning to the temporary variable. Signed-off-by: Arnd Bergmann --- drivers/pinctrl/aspeed/pinctrl-aspeed.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.9.0 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" 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/aspeed/pinctrl-aspeed.c b/drivers/pinctrl/aspeed/pinctrl-aspeed.c index 7d461fc30d3c..0391f9f13f3e 100644 --- a/drivers/pinctrl/aspeed/pinctrl-aspeed.c +++ b/drivers/pinctrl/aspeed/pinctrl-aspeed.c @@ -187,10 +187,10 @@ static bool aspeed_sig_expr_set(const struct aspeed_sig_expr *expr, continue; ret = regmap_update_bits(map, desc->reg, desc->mask, - pattern << __ffs(desc->mask)); + pattern << __ffs(desc->mask)) == 0; - if (ret < 0) - return false; + if (!ret) + return ret; } return aspeed_sig_expr_eval(expr, enable, map);