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: 8391911 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 120E2C0553 for ; Tue, 23 Feb 2016 13:58:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3A5B4202BE for ; Tue, 23 Feb 2016 13:58:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 45C9320125 for ; Tue, 23 Feb 2016 13:58:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753027AbcBWN6h (ORCPT ); Tue, 23 Feb 2016 08:58:37 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:58945 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752954AbcBWN6g (ORCPT ); Tue, 23 Feb 2016 08:58:36 -0500 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 Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org 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= Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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[] = {