From mboxrd@z Thu Jan 1 00:00:00 1970 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 A6602C43219 for ; Mon, 7 Nov 2022 14:19:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232359AbiKGOTB (ORCPT ); Mon, 7 Nov 2022 09:19:01 -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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- 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; } -- 2.30.2 From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0881C433FE for ; Mon, 7 Nov 2022 14:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dEa7wbUiBp8VE0rpXx9Q6M84421IzvuqtHdm4EDufUQ=; b=cjvK/3PK88+0nZ ji3s1ZUN96e8Ua+5IQj4U5yytFrSKRi3aOXE9sjVSV+04RDGA+M0oIIUi89SxtmsamKMX5XUunc4R 5Txy50VvsEPio53AJN6QgN558r6cDwXqJN8n3p+RnJR0amffsQa81+MrJf7eR+e7pf4AGNUQGNiT8 vnPf7btFIo0DtndKb46eJDB0xpFPbbiWmPxAkWwXACHxXs7/bUWK97rcMTPLmTSD/e/SBrfpX3Vjg w5xXZ+gDRwopcqyIERLACiqD0niLacmNw0VPzh4juWjfo/XO01Wbo5Mg+3LLcJjE58cnrRQKyaUx+ 7qFwKhwLhLKerc1SifIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1os2wq-00FAJV-My; Mon, 07 Nov 2022 14:18:00 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1os2vn-00F9fQ-D4 for linux-arm-kernel@lists.infradead.org; Mon, 07 Nov 2022 14:16:56 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221107_061655_603154_9B398C08 X-CRM114-Status: GOOD ( 12.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 --- 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; } -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel