From patchwork Mon Nov 7 14:16:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ogness X-Patchwork-Id: 622599 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B829C4321E for ; Mon, 7 Nov 2022 14:17:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232257AbiKGOR3 (ORCPT ); Mon, 7 Nov 2022 09:17:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232165AbiKGOQ4 (ORCPT ); Mon, 7 Nov 2022 09:16:56 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 688871BE94; Mon, 7 Nov 2022 06:16:55 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1667830614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yx/DFCpNBgX6OWBk9yiOlgcjm4ySqR68jcfyCdumqVE=; b=RwsDLfjO6P/9jgKRgz3idn17Rse6DcJyvmEF99pKAn+m89IIv/rL+ewmMLnsbzlze/PPhf xbhN7RALZQjSju4ionne5siq/3B+wVv/dHr7EQe72v/ahvzE6lPGATLVQ5v/cCBWiDrH1R N9ymsPzyrfVCeWZtinJg4mkwATpsOqGeq2f40LfKS7EVBNu9aPuOrGf1TwrfO7BlKUG7da yNtoEDcVs5XBVWJslZaGkeDa7mgggQ+GLzypRERytrX4KoHPipjBDeMy14tJjapPYrdVFF ZLed3exlDX2omJt6OHNDpbt0CfL4AAHGj2VL1sQQs4bzLP+ctkVWJtqLtsBJkQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1667830614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yx/DFCpNBgX6OWBk9yiOlgcjm4ySqR68jcfyCdumqVE=; b=KiZOPxkkpXsT1r8oIQ23HB7CG/MNqWqgZoYb11rwfEFel9/QBfZxbw/TR1RrKjqA95BbDo WF8ujwxtqJiGpPCA== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Michal Simek , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH printk v3 30/40] tty: serial: xilinx_uartps: use console_is_registered() Date: Mon, 7 Nov 2022 15:22:28 +0106 Message-Id: <20221107141638.3790965-31-john.ogness@linutronix.de> In-Reply-To: <20221107141638.3790965-1-john.ogness@linutronix.de> References: <20221107141638.3790965-1-john.ogness@linutronix.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org It is not reliable to check for CON_ENABLED in order to identify if a console is registered. Use console_is_registered() instead. Signed-off-by: John Ogness Reviewed-by: Petr Mladek --- drivers/tty/serial/xilinx_uartps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 2eff7cff57c4..0cbd1892c53b 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1631,7 +1631,7 @@ static int cdns_uart_probe(struct platform_device *pdev) #ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE /* This is not port which is used for console that's why clean it up */ if (console_port == port && - !(cdns_uart_uart_driver.cons->flags & CON_ENABLED)) { + !console_is_registered(cdns_uart_uart_driver.cons)) { console_port = NULL; cdns_uart_console.index = -1; }