From patchwork Wed Nov 16 16:21:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ogness X-Patchwork-Id: 21161 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp233566wru; Wed, 16 Nov 2022 08:26:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf7+gV9edBi9JSkUWV7gLjPIwwUbbtde+JNzftOcmw5lTztzPMhoPpAfdCOVGUFKMKgoURYk X-Received: by 2002:a17:90b:1bc3:b0:212:ed58:2825 with SMTP id oa3-20020a17090b1bc300b00212ed582825mr4547403pjb.199.1668615968255; Wed, 16 Nov 2022 08:26:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668615968; cv=none; d=google.com; s=arc-20160816; b=OqjTzA+u6V3uJe8EWU/NBy2Et1FDhB/yXvAzIdbQGFeSKbyn7nIVJ0cFaGuYlkVhpD YlpSWRag3j8uN0NfbZ5zZnrqlcZQFhBO/4dcEHjHGSxyjTvxmrtfgWEErIwmMj+QooOm UK20whSyVCp1f6t3pxIfm1J/t08Spk3MwXAXXyUphwG7i7oo1m7IZW/fdlIdGlY+u818 ha2DZtOYyb76WrQFALNBLPciAsk7OfQFbCcq2hm5l5kWtcxZxU7z73yJy1UsVyN9rZtM +R91hU6xRL9trsvL4kTXHVr4xrY6GbXmIJ5Iwl8YwOkSU9w0X/yNWc3Mhfu3mGzbChux LrmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=n0N6+oqs8YDesp1N8syBA/TOKLtd+9UFIcKPgI5bch8=; b=CIrrnvmab3eaefQ0yFasP31zuT4pL82W+ss6LsUTA4RFv1Hf9CxPDS/ldMuKdPFmJR L3jE0FyBc2wi2SbiM5Rpe6tAPoNf8wsYtk3IeuiaJvrf+5C9fWU3Xs7hCNCxLkOsc41q j3FZ72yDtZyb+FOq5cORmB362+aYo/EQLhGSFjyBlm0HRXOcJL3Gn3+M+URcxZHe6Rns g6ioj1sWNt1LPO+U4DFucQZzRuWGE0dihOIm0h3SI0D42vDKs3Nq19MhGQsvhI1i4H4W H50ymfQjVbzSLOF5j1LDiRQRxjVrk5qNHvI85ZYEQAeVToumMcZftl49oexPbAW7Lu3x INEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=wPgQxX1o; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p10-20020a635b0a000000b0043934d930e4si14915742pgb.297.2022.11.16.08.25.54; Wed, 16 Nov 2022 08:26:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=wPgQxX1o; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236176AbiKPQZV (ORCPT + 99 others); Wed, 16 Nov 2022 11:25:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237567AbiKPQWw (ORCPT ); Wed, 16 Nov 2022 11:22:52 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9596057B5D; Wed, 16 Nov 2022 08:22:12 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668615731; 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=n0N6+oqs8YDesp1N8syBA/TOKLtd+9UFIcKPgI5bch8=; b=wPgQxX1oQOVhnIHx4abeauz5e7rEg0cwq5AOSReGNyVI0GuDMJ6kOxzMqgo1hBiby93eiw 5hBeCrKYPerk7JvYO8vosiWvKyDPP4cAvtIpw/1zVg+gGlgIShIO0DOXM0NlWFYl5WeH1w WA8DgdazYTIbRMqodAkgxFBB3+Mm0uDgTkJf3dn5f46ZjCd5kn97toOZnVj/equ7JrSvUO r/4XzPjW/bQmnrL64Or8kzA5/4EVeUCgg1O+2wDvVFNd9QBb1iSKtJUbwpkRHjvnQ/F/U4 G0cFr/34shXiB9Hei+AMjQk4UsbqUF58IDPWuUFjW50qPwjkdAmfQ9w5cU+LXQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668615731; 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=n0N6+oqs8YDesp1N8syBA/TOKLtd+9UFIcKPgI5bch8=; b=MyQecpelV/Y/Ej5hHdh0TQTK+n3Ui1E7BQDeR9U4wt14VpwlS8pr/VUvxnyUuEshVddrWN FzYp4/jEDqsa0BBg== 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 v5 29/40] tty: serial: xilinx_uartps: use console_is_registered() Date: Wed, 16 Nov 2022 17:27:41 +0106 Message-Id: <20221116162152.193147-30-john.ogness@linutronix.de> In-Reply-To: <20221116162152.193147-1-john.ogness@linutronix.de> References: <20221116162152.193147-1-john.ogness@linutronix.de> MIME-Version: 1.0 X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749670657097007727?= X-GMAIL-MSGID: =?utf-8?q?1749670657097007727?= 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; }