From patchwork Mon Apr 9 19:38:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karthikeyan Ramasubramanian X-Patchwork-Id: 10331943 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A8B8F6022E for ; Mon, 9 Apr 2018 19:39:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AB5528BF2 for ; Mon, 9 Apr 2018 19:39:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F43728BF7; Mon, 9 Apr 2018 19:39:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3310328BF4 for ; Mon, 9 Apr 2018 19:39:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753614AbeDITi7 (ORCPT ); Mon, 9 Apr 2018 15:38:59 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:42426 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753923AbeDITi4 (ORCPT ); Mon, 9 Apr 2018 15:38:56 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2B4E360250; Mon, 9 Apr 2018 19:38:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523302736; bh=WcnEt4TinSJjJJbz2W8wYTTW1AgjFRPt6IAWOVSJ9tU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XIHShLycI9f33Cqh5+ppcudCF5i0jjmCMQlM5jBSas967VyC6TQYLZOOCOjvG/wiy kRSohTrSdp73/bt+SGImOYuAh5AKCvCPzQk5uJ0UNdB5eFhDKhQLU/xW6AvH+RD9PM EJ/cB/QZHWVPR7H1ygZTCK1q9dPFwjheleKY8eVY= Received: from codeaurora.org (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kramasub@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 764AE60F93; Mon, 9 Apr 2018 19:38:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523302735; bh=WcnEt4TinSJjJJbz2W8wYTTW1AgjFRPt6IAWOVSJ9tU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l7GaK6cd6AAAbfGh53HJpg7lbfEPHgmhmIrcu/SQEjBO3pDVoby+tw1hTaO44l+4f ZhB3HxF1XDoACM8QLTEaMnvECV19Rnzn2Ow1mSs6qg9cfRJJ9XTJj8OYm6J+DAagcv gxwSRcIv++hRe4LEUVox54zHW01VJpQoxZuVueOQ= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 764AE60F93 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kramasub@codeaurora.org From: Karthikeyan Ramasubramanian To: gregkh@linuxfoundation.org, jslaby@suse.com Cc: Karthikeyan Ramasubramanian , linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, evgreen@chromium.org, acourbot@chromium.org, swboyd@chromium.org, dianders@chromium.org, sdharia@codeaurora.org, girishm@codeaurora.org, festevam@gmail.com Subject: [PATCH v2 4/8] tty: serial: qcom_geni_serial: Initialize console port statically Date: Mon, 9 Apr 2018 13:38:37 -0600 Message-Id: <1523302721-19439-5-git-send-email-kramasub@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1523302721-19439-1-git-send-email-kramasub@codeaurora.org> References: <1523302721-19439-1-git-send-email-kramasub@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Perform static initialization of console_port instead of initializing during module_init. Signed-off-by: Karthikeyan Ramasubramanian Reviewed-by: Matthias Kaehlcke --- drivers/tty/serial/qcom_geni_serial.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 21e9160..67fd285c 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -105,7 +105,7 @@ struct qcom_geni_serial_port { bool brk; }; -static const struct uart_ops qcom_geni_serial_pops; +static const struct uart_ops qcom_geni_console_pops; static struct uart_driver qcom_geni_console_driver; static int handle_rx_console(struct uart_port *uport, u32 bytes, bool drop); static unsigned int qcom_geni_serial_tx_empty(struct uart_port *port); @@ -118,7 +118,14 @@ struct qcom_geni_serial_port { #define to_dev_port(ptr, member) \ container_of(ptr, struct qcom_geni_serial_port, member) -static struct qcom_geni_serial_port qcom_geni_console_port; +static struct qcom_geni_serial_port qcom_geni_console_port = { + .uport = { + .iotype = UPIO_MEM, + .ops = &qcom_geni_console_pops, + .flags = UPF_BOOT_AUTOCONF, + .line = 0, + }, +}; static int qcom_geni_serial_request_port(struct uart_port *uport) { @@ -1133,11 +1140,6 @@ static int __init qcom_geni_serial_init(void) { int ret; - qcom_geni_console_port.uport.iotype = UPIO_MEM; - qcom_geni_console_port.uport.ops = &qcom_geni_console_pops; - qcom_geni_console_port.uport.flags = UPF_BOOT_AUTOCONF; - qcom_geni_console_port.uport.line = 0; - ret = console_register(&qcom_geni_console_driver); if (ret) return ret;