From patchwork Mon Apr 23 09:51:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 10356539 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 2AD2360225 for ; Mon, 23 Apr 2018 09:55:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AB2728A01 for ; Mon, 23 Apr 2018 09:55:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0EA6B28A05; Mon, 23 Apr 2018 09:55:18 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 76CC228A01 for ; Mon, 23 Apr 2018 09:55:17 +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=FzOo8uvXL6A9UgeSmMSKrrW1POzIwJNyyv6NBcs5zbc=; b=KCu1oFfaqshmnQ1qrJZTPjH6eW ijHC0wBd91KsHsIj8ihVTwCpe84v5Sc9qr0CVElO3HGDEDschTDQhRc/oeOZr8d6sAi53bwThIVQQ Ny3udMYgWOEXvbBYpcXRhJyS998GfJ501s+dulClOxQ67q/7CRmG1jV1kKZ/nSqfFvVSh9ioR8EQM PsHuXH2g8wZlju0EBhB1So3X9HpDfeRaeLt5umgS0lL8xKePJ8OFza+iMOpjikcdC/mtbwd25Z9Yg Z3XQWjtyQ4H9aZejZ+Xe2F4RI9z4Vh5cZ7ZC1htQxFUb/+b7IqSKeZa7bx3PamlovBekOrDZ/iTZr eXIf6UIw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fAYBf-0004Pl-Rq; Mon, 23 Apr 2018 09:55:08 +0000 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fAY7y-0002lq-7e for linux-arm-kernel@lists.infradead.org; Mon, 23 Apr 2018 09:51:28 +0000 Received: by mail-wr0-x241.google.com with SMTP id v15-v6so21317383wrm.10 for ; Mon, 23 Apr 2018 02:51:07 -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=yWe3rH4JgcrU+Dmuj8JOeUllojMi7HBcy7yj1dVZVpg=; b=OK9Fo08dUB/y4bcyTGRVW17jbDKdotfWiwkmGOYzeYX50OIsr3fFQDpD3ZFVPW6t8P O3zI1Q0OPymx+cwcn/nCBEhj9Kfk8z9UwHAsfvYmF8ZK0boUzav5ZWOl7GxdGo6u1gN8 gQjy6GkYAhfrNgWC7/dltrNMbAxVTN8cTSyVw300BYXTMJE4z7IQVwl42j0QIDVLSLa9 s/6s2LOCMZsMMp2/90zfnb/wriAppHz3sfhXrRxdOEe3UL7U8Hd3RlBgnw80BLQdJL8B tGjhUdApXTxrd/Q5hyk846nvW2KBMFiYd+6/5xQvxnQQf0FImguFpA85FBVsEyvRzozU 9YGQ== 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=yWe3rH4JgcrU+Dmuj8JOeUllojMi7HBcy7yj1dVZVpg=; b=QKLn1EcfWrlzCQQeOaX0jUd2PTTqrmkNR2ZTVHNHeqikkqewUyPjgLd9b689JlppA6 4La94EOEMJ7dJGgWXkeskHrF7CJj+H07QyYJRd8Xw7U09YWGiShBKULZgDyztRxcIgbx pZG2dOXA/FdAIr7DSr+22DvJUgA2X29D7NGlZP3wfHDXcZRVhLQ1izVE3mH+tdsbF/vB 4/lsUuRDud+cNeioMq3tjYLL3KBPTsEvY9IxYTFG1dcfytIKGqEhIDcK8zWwFqkUSGiK FinUY817DyoYnoZTW5GUUwkOIpyPs5Un9VBmEzDDGOdWAjCz8ZfugnwcN1yYmL5Z7Hn2 fVEA== X-Gm-Message-State: ALQs6tAlPbxHVU3rgUwfAZsDOyO9a+KXWZ+l59CZRQEyUJCRceP0LDme lFjFiDMBN27aRqWf4JNYYm8fTw== X-Google-Smtp-Source: AIpwx49QBzv/uNeL/XydSDrddi55NUAVd10Pf/e1ManTOxMidmOYNhX4ymN9BGSkKi7KSkU9syifRQ== X-Received: by 2002:adf:9654:: with SMTP id c20-v6mr17309854wra.89.1524477066249; Mon, 23 Apr 2018 02:51:06 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id v134sm7422214wmv.32.2018.04.23.02.51.05 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 23 Apr 2018 02:51:05 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu, Alan Cox , geert+renesas@glider.be Subject: [PATCH 1/4] serial: uartps: Remove console_initcall from the driver Date: Mon, 23 Apr 2018 11:51:00 +0200 Message-Id: X-Mailer: git-send-email 2.17.0 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180423_025118_304793_A20DD72B X-CRM114-Status: GOOD ( 11.45 ) 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: Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, 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 Reviewed-by: Alan Cox --- 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 bd72dd843338..932210331484 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1293,20 +1293,6 @@ static struct console cdns_uart_console = { .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 = {