From patchwork Wed Nov 16 16:21:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ogness X-Patchwork-Id: 21159 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp233512wru; Wed, 16 Nov 2022 08:26:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf4yJ+Bra0XII1Xi+39KAZBKQkjyh6gzTtSF8nxVaNra2oyFz5ZIjtaz0NJhj1URXN3gx7K+ X-Received: by 2002:a17:902:f601:b0:17c:b7ac:86f with SMTP id n1-20020a170902f60100b0017cb7ac086fmr9556360plg.140.1668615961358; Wed, 16 Nov 2022 08:26:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668615961; cv=none; d=google.com; s=arc-20160816; b=tNoMTfcfzkoUBj61Ug25ialkYU96FxlI/iUQ9G6ffumOwmAJqjPGXh4Sr+uliX/Gyl vlRj1K7mjuv4AruI/2tLnxEtGsMY26fOSWxve5C7cKgwdMmuzjltPdFoM8ew9CEe9Poj coKZZ1VhRXQfVK6j62nShDmTiZcEaURCAp7rPBCgsLX/RROFNStSgyPSnESnWnl8N3ws 7aK6Mqjzas98thy6o4062cz9NI9d/VLwNEbBF276bkm5ME4iBzRpLuzdj0QCrKLL9ni+ VMauseXEnRGP1Fc9dgl4kND4fcvndWQT/Dc8G+qes+P2hHRLhB0gzT6x1GV0PSb0unAl x9zg== 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=mrnamDANz6jBB9jzBVW9G8ct2/m0qCRJ/AQBo5wVT6Y=; b=Z6PJmzqg1qLdfZ4EmRu9koPmsOihmujZOKTqPnMasE+IbzuUgJLDaVhrpXZPHslOol sAcK2Cj3pdht4lBaxvKZGvzv6pJL11dHHRtm+jp+LjpwdSXdmhAAmwxGW22JC6V7H1CE kjzmDXhjMVfu/6uYcMlNpKIcMREYDNyFlHiOL1sbfV6MshW0iznptKWLqrTTqI+uY3Il DpKebmwauvN+tLJIt9EuN92f2ZNFFAA3Z14/EIti0bsnArN6VTr74hxZCzIyzAiu75m4 F7+A8piJXOygA5mP8MpQOygq04epj9XLgnlv94CRiSs6j85h3sv2XZv/fv+lrXVcv3s9 pXYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=IHfhXeIj; 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 rm10-20020a17090b3eca00b00213d512f07csi2415936pjb.182.2022.11.16.08.25.47; Wed, 16 Nov 2022 08:26:01 -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=IHfhXeIj; 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 S238910AbiKPQZN (ORCPT + 99 others); Wed, 16 Nov 2022 11:25:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234897AbiKPQWi (ORCPT ); Wed, 16 Nov 2022 11:22:38 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3FFA5800A; Wed, 16 Nov 2022 08:22:10 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668615729; 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=mrnamDANz6jBB9jzBVW9G8ct2/m0qCRJ/AQBo5wVT6Y=; b=IHfhXeIjsu1hLZtohnzmRyDQmIktHtCYtoLquUTX2WSs5AO+5oHUdvyoEj3rssbn/r0Y/n LMkEMBqml3FqzurxWRiZbvgQnknV+eWTnQhVjLO4dqmzTHdT6nEJ/dHdm5ueYtBLFKnVPG 7np6nZtKtTBIMf2c1cwFYwYyJXAnKkmrvQZyEAr0GTCs9TTNGzYN0X64YR72T3shSCPxGM PBt+JjIrnMCiHi276+OsE946KngZDh4Ca/QFJt3t66u781zZfphAn6s3CglQk0EWgWzB4R /N6YP7kfixbkSrERtdxAiyQ8AkodcDy2N4VKRKd96wdm31dqJaNXmUvQIxGZBg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668615729; 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=mrnamDANz6jBB9jzBVW9G8ct2/m0qCRJ/AQBo5wVT6Y=; b=olP4GBMpkyeoYDHbACveIAi5zWc4NUMK1WYldtniy3N5RaKslutK2zK06oNEdudevtz8ET WYnWXIL4VwK4nqDQ== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org Subject: [PATCH printk v5 27/40] tty: serial: pic32_uart: use console_is_registered() Date: Wed, 16 Nov 2022 17:27:39 +0106 Message-Id: <20221116162152.193147-28-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?1749670650367610893?= X-GMAIL-MSGID: =?utf-8?q?1749670650367610893?= 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/pic32_uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/pic32_uart.c b/drivers/tty/serial/pic32_uart.c index 1183b2a26539..c38754d593ca 100644 --- a/drivers/tty/serial/pic32_uart.c +++ b/drivers/tty/serial/pic32_uart.c @@ -843,7 +843,7 @@ console_initcall(pic32_console_init); */ static int __init pic32_late_console_init(void) { - if (!(pic32_console.flags & CON_ENABLED)) + if (!console_is_registered(&pic32_console)) register_console(&pic32_console); return 0;