From patchwork Fri Jun 26 18:52:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timur Tabi X-Patchwork-Id: 6682701 Return-Path: X-Original-To: patchwork-linux-arm@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 37C70C05AC for ; Fri, 26 Jun 2015 18:55:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6BC4C20647 for ; Fri, 26 Jun 2015 18:55:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 894B620639 for ; Fri, 26 Jun 2015 18:55:34 +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 1Z8YkL-0000Mn-0J; Fri, 26 Jun 2015 18:53:05 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z8YkH-0000Kg-O0 for linux-arm-kernel@lists.infradead.org; Fri, 26 Jun 2015 18:53:02 +0000 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id EFD4E140D4F; Fri, 26 Jun 2015 18:52:40 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id DD351140D53; Fri, 26 Jun 2015 18:52:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from timur-ubuntu.qualcomm.com (rrcs-67-52-129-61.west.biz.rr.com [67.52.129.61]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: timur@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 02341140D4F; Fri, 26 Jun 2015 18:52:38 +0000 (UTC) From: Timur Tabi To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Shanker Donthineni , awallis@codeaurora.org, abhimany@codeaurora.org, will.deacon@arm.com, sboyd@codeaurora.org, Vipul Gandhi Subject: [PATCH 2/3] hvc_dcc: don't ignore errors during initialization Date: Fri, 26 Jun 2015 13:52:35 -0500 Message-Id: <1435344756-20901-2-git-send-email-timur@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1435344756-20901-1-git-send-email-timur@codeaurora.org> References: <1435344756-20901-1-git-send-email-timur@codeaurora.org> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150626_115301_801928_278FB118 X-CRM114-Status: GOOD ( 13.30 ) X-Spam-Score: -3.3 (---) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP hvc_instantiate() and hvc_alloc() return errors if they fail, so don't ignore them. Signed-off-by: Timur Tabi --- drivers/tty/hvc/hvc_dcc.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/tty/hvc/hvc_dcc.c b/drivers/tty/hvc/hvc_dcc.c index 33657dc..f8b8cf2 100644 --- a/drivers/tty/hvc/hvc_dcc.c +++ b/drivers/tty/hvc/hvc_dcc.c @@ -225,20 +225,29 @@ static const struct hv_ops hvc_dcc_get_put_ops = { static int __init hvc_dcc_console_init(void) { + int ret; + + /* This always runs on boot core */ if (!hvc_dcc_check()) return -ENODEV; - hvc_instantiate(0, 0, &hvc_dcc_get_put_ops); - return 0; + /* Returns -1 if error */ + ret = hvc_instantiate(0, 0, &hvc_dcc_get_put_ops); + + return ret < 0 ? -ENODEV : 0; } console_initcall(hvc_dcc_console_init); static int __init hvc_dcc_init(void) { + struct hvc_struct *p; + + /* This can run on any core */ if (!hvc_dcc_check()) return -ENODEV; - hvc_alloc(0, 0, &hvc_dcc_get_put_ops, 128); - return 0; + p = hvc_alloc(0, 0, &hvc_dcc_get_put_ops, 128); + + return IS_ERR(p) ? PTR_ERR(p) : 0; } device_initcall(hvc_dcc_init);