From patchwork Fri Jul 21 09:32:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 9856375 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 76883601C0 for ; Fri, 21 Jul 2017 09:33:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 696E02869D for ; Fri, 21 Jul 2017 09:33:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E414286A9; Fri, 21 Jul 2017 09:33:56 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E8A6E2869D for ; Fri, 21 Jul 2017 09:33:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ZPP5PHwrpKSkrGhHFOIhf9AWdwyx9lkDW/KmyPJ+wSA=; b=R+yOgPrRFeM92NoBKPE+sutq/6 nrO5HuLVXHKq2yDsmiVPM40QdyQKhaweemGcQHqMgVPPj9rMQjEYviTsETKGDxcNoDOhdxwIEC84p uHdrAm9SIUaIwfGYKgaMRkQqekMLZERkO1ZwHqSV78bYD6wpXC5nyc17oZ3Vfhx12qNqAo5LLrgRI xEIDRol9X0lZdQXuxaTQqrr00rr6NMl2O49y7cZMGQcEn2NtbRmjwLhbUSyvmB4CDyJjKzDXf2CTt Rey9rbQlZVQ4QwAJaf3/lyGKcxZFmw8q0tVw6CFU5YPUj1MOHjFy8d2KHiL6JeuNsEY4Z7VX9GDao OtiMf3eA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dYUJm-0007MT-0c; Fri, 21 Jul 2017 09:33:54 +0000 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dYUIn-000755-8k for linux-arm-kernel@lists.infradead.org; Fri, 21 Jul 2017 09:32:57 +0000 Received: by mail-wr0-x244.google.com with SMTP id o33so4417216wrb.1 for ; Fri, 21 Jul 2017 02:32:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=0oFIBx/7AbemS9qFoHut5Z4VxoJerBS1vyY7tEaJqYA=; b=o1frYa3e9Rknwdmh9kPQlTMkP9+0CBVA0S9pdzAlroGO5+PsTN0yCx74sfrxMACBCV YXhxmvyXM0Mn6BJ7nIUYNVxK3pJdwBrq63qeZK54VBd3ZQB3ObLN77NqffgV+hAGxGbZ S3m9v5qeYb3Hnc3PCdmXh/UZsT1+/6fwSbkuzbq+vbU+WCeTKo6crZDhf32ZVDrskcid Or1ZiXGSROG5Atu2eFDc8/IRCFlhNISftfQJf/Z+j9FHxF2BIqJfpQWd0n8jeV0DZbCb 5ZEMdGpf+iw72P1Ngl9yLAGyfMVlJLWHyktL7G3nlBeMNeSIcSk1ZTzCTZRnJzBhtbgB vagg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=0oFIBx/7AbemS9qFoHut5Z4VxoJerBS1vyY7tEaJqYA=; b=Kl7kIz+44UgUnm92kQTfvCMuek85xvGg07wO8j8iUs7UuNlckS58FvguVyUSDFX5JM eaQET+pklVVTuR06xeN2NwW2iOUs7m6JO8bDyh6GvBOUM6L5r27MleKxrjDwYpF3Ud64 61ckplyiQpd/FY/vEsGK7zPk9qE7vFCmWuwPb1U2yoPofQM3BHTzv+VIuZI13gnFxiie Q0/pWyaqgac5jiH8S1+cL1U5oQlo+blm3iZfyN8Fej4ZW9BmAXTJbbhdYpGB7u6eLlsZ pEQlwsm5wp64b34FCzUdqxIMcz7bO7lL8ug1c0BXJMYQUsJVka2qPv4CGUzKJolEGjg2 tcEg== X-Gm-Message-State: AIVw112xMLSEqm30ve3hcN/P71aGqhT31nVg3X54VwYLK1ZMtiM/QltZ U8DIOCN+qcLsTTJR X-Received: by 10.223.130.50 with SMTP id 47mr2338195wrb.145.1500629552797; Fri, 21 Jul 2017 02:32:32 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id 199sm1050034wmu.0.2017.07.21.02.32.32 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 21 Jul 2017 02:32:32 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu, Alan Cox Subject: [RFC PATCH 1/4] serial: uartps: Remove console_initcall from the driver Date: Fri, 21 Jul 2017 11:32:24 +0200 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170721_023253_503321_F43921B8 X-CRM114-Status: GOOD ( 11.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Greg Kroah-Hartman , linux-serial@vger.kernel.org, =?UTF-8?q?S=C3=B6ren=20Brinkmann?= , Jiri Slaby 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 register_console() is called from uart_add_one_port()->uart_configure_port() that's why register_console() is called twice. This patch remove console_initcall to call register_console() only from one location. Also based on my tests cdns_uart_console_setup() is not called from the first register_console() call. Signed-off-by: Michal Simek --- I am not quite sure about this because console_initcall is called early but I can see any difference in usage. pl011 is not calling this but others are doing it. --- drivers/tty/serial/xilinx_uartps.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index fde55dcdea5a..4614349403c1 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1298,20 +1298,6 @@ static int __init cdns_uart_console_setup(struct console *co, char *options) .index = -1, /* Specified on the cmdline (e.g. console=ttyPS ) */ .data = &cdns_uart_uart_driver, }; - -/** - * cdns_uart_console_init - Initialization call - * - * Return: 0 on success, negative errno otherwise - */ -static int __init cdns_uart_console_init(void) -{ - register_console(&cdns_uart_console); - return 0; -} - -console_initcall(cdns_uart_console_init); - #endif /* CONFIG_SERIAL_XILINX_PS_UART_CONSOLE */ static struct uart_driver cdns_uart_uart_driver = {