From patchwork Tue Feb 23 13:57:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8391981 Return-Path: X-Original-To: patchwork-linux-arm@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 879759F1D4 for ; Tue, 23 Feb 2016 14:00:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AF6D120122 for ; Tue, 23 Feb 2016 14:00:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CA16520253 for ; Tue, 23 Feb 2016 14:00:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYDV1-0001FW-P4; Tue, 23 Feb 2016 13:59:35 +0000 Received: from mout.kundenserver.de ([217.72.192.73]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYDU0-0000Vq-Uc for linux-arm-kernel@lists.infradead.org; Tue, 23 Feb 2016 13:58:34 +0000 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0MHYWy-1aUv9t2glI-003Kf9; Tue, 23 Feb 2016 14:58:13 +0100 From: Arnd Bergmann To: Tony Lindgren Subject: [PATCH 3/3] ARM: omap1/ams-delta: warn about failed regulator enable Date: Tue, 23 Feb 2016 14:57:53 +0100 Message-Id: <1456235876-4088840-4-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456235876-4088840-1-git-send-email-arnd@arndb.de> References: <1456235876-4088840-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:nv2so6xYQsQO7azwUlTBuPYCOiLtApEwfSdIelgjNCW/1IJX66D CoDkPu6BMSNYBeL+nW5usPlcisAwTamJ9wPKW4BIekIWNPRPuTPrM/vk3mRW+AA/fAVPrlQ SztNSuktmjiA5Q+mRTfTzvSGB3/Xx2U0/v2hwAQerQK6QyQtXz2J1QgGnnTevWPmd3x6AQ0 3TbiTjExkwICDiUfwMrdw== X-UI-Out-Filterresults: notjunk:1; V01:K0:nSqpW/y7Jog=:PiULBmefyGHB7CS6hI0SPK Du6SZNLJC/lyamSCd21q/Sru40qHAOTkGwft5JAVKIjk2E6NOSMpr/TxnA6wcEvywqhWmMM/S kb3v8FiWLChu1dwXbLwp28C2uFUTpRuSl4+iKumVV4j4vdp8K3sizB2PH/hmJbEpvWdsq+uRH kebw7HEr9DOlIL63aqv1IXY3/vqP2F4bJ6KfGgIiVK9s3zPQ+3CYmPh3Yu/B1bR8z+rRBS1qf trmzKNpy1J5FV1jJd9Stzmkx7ydIhynhS6iQuJgOa6/vTxGh6IdMvHbkwrGV33AEB8AIeKaH0 vnun8WVaANT08vTboxZ9bUWrTxINRtkhFenDneJZrpQjnW5Qy69kEfaZA6h3U/es6CDo2aj0h 2mcEhhJdrLN27IwL24xZ8Vffy1l7NYgrwh2T2mXqgPEmYy6geskHGRRlLYp7b4q0qUlhP4GMw UzeadeMw3PsAYPmOjlXeWCtnEAQBny86KgvOCairghxciBc1F76GYWikPISErQ1UK/m5h6PQN 9yFz5q4uIqI+lh1Z6/cy9oODca+/dExa4/nU37AZTfqv1vBk7C+u1XjiUZfK6w2P0i1wnjJld Nr6o0mN67L5clLOhvGyMSA8Ez3DxqRinMH0/GYAqFbkQi9odHRt0fEjSYqLz1hM5v4yAyu2FM dT8ZkIC5PArYaACuBqj2V4YvjGcd7+cys3FnEUcZclkcJ1tY/3zJANnvEqae55trQ4a8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160223_055833_518302_1D47CF33 X-CRM114-Status: GOOD ( 15.69 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-omap@vger.kernel.org, Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 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. Signed-off-by: Arnd Bergmann Acked-by: Tony Lindgren Acked-by: Aaro Koskinen --- arch/arm/mach-omap1/board-ams-delta.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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[] = {