From patchwork Thu Jul 20 15:53:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108400 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2309141qge; Thu, 20 Jul 2017 08:54:41 -0700 (PDT) X-Received: by 10.101.69.135 with SMTP id o7mr4305822pgq.242.1500566080915; Thu, 20 Jul 2017 08:54:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500566080; cv=none; d=google.com; s=arc-20160816; b=f4wlQHqfrPZ8kF1zRkiMJFZZVRLy9zvvgnL3ZDIY0yoKSZHtp+vYD5i9I0dh/TgYT6 o/Wc3gXeoAZQso48muOAdWF2Wbw3vh7UaVqJkfTGBOzb8ybNryhiH9+CgDt19a2rlmLQ jgMpbVzEh175Y5fuGeUifZP6swZSW2oLr6PLZO359KLTQ7ob3cdtFgmiaLIFZyqXlpgv 2zL7srD9TZ1KGg3OyuiIxcvWw2Grqx2cSPAdKCOp2PeU5b/XL3erZP3edhVJnbcHDZ/j C/TiEKpSTPL4lykgUl2lVQ5Qizcoa5wyoyXq0WtEzD8oQFsR892iZSPP8ED35g/4saZp v2OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=JaNTAVw4BAPLWC2+6w3x+C7FwgPI7I0J0mEbEsfRxrw=; b=pLEJTbIvYG1TRDX3Ua6GMQRdFNxtqPG3qQRhtCvbCEZWMPLHzfTeHOaxcR0g4VPboR atY6+pWqBObxMjGgGJ09wO98yQ70V5PB4ZbtCQYMkMHnpddaxLfClGlOMFNFkOv0RCi/ JpMiehnKzCSyMBDHI/4z4SVTNI2EhdJ6OA5I59FNmEPmyAfFQvc90cDwtT7piv2w5Q5g aZWrfCYji9NaNt60wd7NtJvje+5Cts+6HQyMzoop8QhhLbYXAWYYeU2xFy5+8MQKYupj Uk8srQ42x5PKwHkOWdeC67FKvCiswYrzeiB/xpkQd+F7m75NInDA8k6nLxe/Kutmzz9k wepQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a7si1707231pli.710.2017.07.20.08.54.40; Thu, 20 Jul 2017 08:54:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936526AbdGTPyh (ORCPT + 25 others); Thu, 20 Jul 2017 11:54:37 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:62184 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934344AbdGTPyf (ORCPT ); Thu, 20 Jul 2017 11:54:35 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MhUV0-1dCgWB415u-00MZor; Thu, 20 Jul 2017 17:54:26 +0200 From: Arnd Bergmann To: Aaro Koskinen , Tony Lindgren Cc: Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/12] ARM: omap1/ams-delta: warn about failed regulator enable Date: Thu, 20 Jul 2017 17:53:44 +0200 Message-Id: <20170720155410.3251043-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170720154616.3250481-1-arnd@arndb.de> References: <20170720154616.3250481-1-arnd@arndb.de> X-Provags-ID: V03:K0:6HwnaJ84zOYCAlhUNMmm89G3kOxuoRgRquwZ18OivjJ5u/Eibpx WMmhKaooBYZdiESY+b0T5nqVHRbTZGMhgpUQSv8KiAM8528rGPc7O+wcEzA9pxMxOAVFOzE XG2qPiYmoXJkm+VFWgWML4PKpr8mioVr94V6cnmjg9U61ZblnH+b7PbFFRslq8Yhze1VIvk 7PW1oOuia/WFAkAN+emZg== X-UI-Out-Filterresults: notjunk:1; V01:K0:1p+WNOW+2kU=:UffuASmKOopQz50qLIVw1/ XjqWffCuUD5w6+CPGRtW09sGHsF4LojNisZeNv+W7LubvWV8YcLUpWXGjOVXNBRBGtnnrFhIn N7ohl43PdOQ2xe2sgGhAfzd1xCEPs/vSZpuW/X5WKo/xO4EV7O/OOkI+daY/Qtnf589nhGjDn JJHozL9XYCMm0mZl5pixn5Kffxw3y4McO/vFto5xaW88xZyz2bs0zfN1HSpqwVTjjZVGtY14R iOiL/dVIAfdRsPhpSRz4Lp4WEqSOG3yRHHRiHmVqDQ1nystmw6EGeeq3uHh/ZCyOaKSSlhBQ5 6eF1sNMnEccSemSDk7Sra47dRC7UKc+VLgWEP1X9Eh3qqxkGz+Ddp84dG1AKYqRv3434iRJv2 XRE1fHyFfVYvZJFN9NHuesjr0OgGmWWMwNbQqN1lBgQuvRMhbYarU2NXwWyCXYF8Bb6eJmzy3 nzFviRP6FuoulvjssOe8jF5/9LDp8Vf4A8+WqYzfbWVj87Gs+rjdKsKXG0JEKQO2OJWEh9pjY hQgr0AKRml54W4dIJ+1ZZDROilCe9u0gIozBfS1mm3r1XU19dzFK1OEwWW5fqYsLJKc29xRNh vUd4m+OHzPpS1zcWl17TMxcsBvWPRpV9CjMbICqRZ2nhWOECRlAQ9Ll/sqaBQNxQLRFr5MWJG nP1ne0hK4EOYRNySffZzu3kLDE/DbEqXuAVz58NxvXGY7+0vTz0OwitJR/TMKeesNXVzsRhgL 0zkIDGB8PCzQFN6O31XHrHmJdTaS767bHFlFng== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The modem pm handler in the ams-delta board uses regulator_enable() but does not check for a successful return code: board-ams-delta.c:521:3: error: ignoring return value of 'regulator_enable', declared with attribute warn_unused_result [-Werror=unused-result] It is not easy to propagate that return code to the callers in uart_configure_port/uart_suspend_port/uart_resume_port, unless we change all UART drivers, and it is unclear what those would do with the return code. Instead, this patch uses a runtime warning to replace the compiletime warning. I have checked that the regulator in question is hardcoded to a fixed-voltage GPIO regulator, and that should never fail to get enabled if I understand the code right. Acked-by: Tony Lindgren Acked-by: Aaro Koskinen Link: https://patchwork.kernel.org/patch/8391981/ Signed-off-by: Arnd Bergmann --- Originally sent in Feb 2016, but it got lost for some reason --- arch/arm/mach-omap1/board-ams-delta.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index 6613a6ff5dbc..6cbc69c92913 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c @@ -510,6 +510,7 @@ static void __init ams_delta_init(void) static void modem_pm(struct uart_port *port, unsigned int state, unsigned old) { struct modem_private_data *priv = port->private_data; + int ret; if (IS_ERR(priv->regulator)) return; @@ -518,9 +519,16 @@ static void modem_pm(struct uart_port *port, unsigned int state, unsigned old) return; if (state == 0) - regulator_enable(priv->regulator); + ret = regulator_enable(priv->regulator); else if (old == 0) - regulator_disable(priv->regulator); + ret = regulator_disable(priv->regulator); + else + ret = 0; + + if (ret) + dev_warn(port->dev, + "ams_delta modem_pm: failed to %sable regulator: %d\n", + state ? "dis" : "en", ret); } static struct plat_serial8250_port ams_delta_modem_ports[] = {