From patchwork Mon Nov 14 16:29:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ogness X-Patchwork-Id: 19905 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2239247wru; Mon, 14 Nov 2022 08:33:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf6cXv28eG3BlATm2N/HWzw4un2jlZe+KBwGk98cYhzqBVsmIboj4bI2FjNkKnwo6ILRXXkw X-Received: by 2002:aa7:c9cd:0:b0:458:dd63:e339 with SMTP id i13-20020aa7c9cd000000b00458dd63e339mr11301686edt.81.1668443601560; Mon, 14 Nov 2022 08:33:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668443601; cv=none; d=google.com; s=arc-20160816; b=GxTC0JKcKstWxpBVjo4MvXvt2lYD2WPgp+DinRTt2Op4Rh7yLL25Qjl0+FnV9TqQ83 NhhIMGMx/OXRdy8XjuX5Lm2IC4SzW9JHuCjv7AGaAGw7JYIq0DHv5JU8AWjXowZUhknN 1mrPI5bfAw/FgGdTfpHVQWOjDkBY9UGHB6T2CRIco7UbcnJT2msRQ+amVvEicdQCxEb0 7GHP5SM9faVhGicGdjP5d7P03KQpCMrhsgrSjIqJ7tFuxPVkinwv7VCUkqjWqMpsh/F9 WjgdPykzhC5FiaiS5IBeO740wPCEeu/8r4mZR1Lm33ghxLfZ8/PHNroQVUvEEL+3o3gR 1y2g== 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=TfaZgwVXCTA9bCbWXFgIYcilhlXu0/LjfwIP5LQXs8gz/seHmbxhwD0311MjXK/OmR Ll4t44y/XfVA0FsYn+e7kCXFh0gj+DtAbZ76yPyYF7HnBeQpdF8oei0Kvq3h483TiRY9 PSnviI1UMkKvvJ+r2HndRzMfmcS8hl7oRvm2nhUNgVGdhk6ZZ23NUPCfFgEfX4GbEBuT 1XlA76Eo88ktV/F58xAtprdndK856uik4aviIR00YHYiPMZhxd2sR3ZkqNduDRX8Ir64 2Y9fe0Zn+rdjrdkATgSg8mu6FQLqBoMlQGuBqnG7XLf3ip2OTYczRdCx6KH8IQJNduoX SIOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ik2gD9BO; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Uoe89GI1; 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 h11-20020a05640250cb00b0046786a5845bsi7048093edb.567.2022.11.14.08.32.22; Mon, 14 Nov 2022 08:33:21 -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=ik2gD9BO; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Uoe89GI1; 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 S237820AbiKNQbZ (ORCPT + 99 others); Mon, 14 Nov 2022 11:31:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237654AbiKNQa2 (ORCPT ); Mon, 14 Nov 2022 11:30:28 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43E5B2EF25; Mon, 14 Nov 2022 08:29:47 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668443386; 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=ik2gD9BOKao46XxC6TCnhhimQDLLmozLcpFqx8TKS2W9AAAd4RnuCQ2bbQ0lycjPzLklxr bcWWY0yPWfLHpyeO9hFwAENCRqzfQKAEh5roFS4NyO/1agfgHbS3OYDOgKPGCxeprV7uIO zkkDNu7gLoREFiNWcd4hDuLclqz7y5wl/T7tXeXDPZ3Kcn9jDx7zTPSxIsjapD+aBZ3/BI nrxxvjLJ6qavZNgJvDUf7bzbc2RQgImUqfCo9hEv7r9gdbrfk1y9g5Q8AVnEraLBLW0xjL Jt+H43JfgrbRSOf9agUO1nr1C/4UZTwTnBO79gwlqQ0c9FOywltgef+g6i6v2w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668443386; 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=Uoe89GI1hDDdlGtS8mprP9W4jqx12PfBaIfPlDAV+vJIME0qk0i3PB8PwGQom6PfluumiG h1bZyaC86Q6Jd/CQ== 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 v4 28/39] tty: serial: xilinx_uartps: use console_is_registered() Date: Mon, 14 Nov 2022 17:35:21 +0106 Message-Id: <20221114162932.141883-29-john.ogness@linutronix.de> In-Reply-To: <20221114162932.141883-1-john.ogness@linutronix.de> References: <20221114162932.141883-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?1749489917876144236?= X-GMAIL-MSGID: =?utf-8?q?1749489917876144236?= 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; }