From patchwork Mon Nov 7 14:16:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ogness X-Patchwork-Id: 622600 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 C040BC43217 for ; Mon, 7 Nov 2022 14:17:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232196AbiKGORS (ORCPT ); Mon, 7 Nov 2022 09:17:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232066AbiKGOQ4 (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 6260F1D307; Mon, 7 Nov 2022 06:16:54 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1667830613; 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=4rGpLRcOY1creCvrfbqnEjYKevj7W16ctfWNljowJxQ=; b=vZt3kVuam9R9etVm3fVrEDFZRNLO6OuUaHAFGZLCS/ARafi7y9g+tZ3JIlBY4xViYlIDUD XVgslok4nnZBYTbZ1KDUHfVATLHiT/SL4wXCc9ayaNzxG2p11l9DT1lmoXu7hWOMdXm/4Y 0T6pvnDP0vP7VuAMopEbQ5TSnXdFNYBvj4udWeynojuCdS88R+oe6dMqSs9g4sdPGpG6ix 9N+cwJPjdLZHSCou9vTvLp55ApNi5p4xygKM2NnfO78PHp2jFGdV0Hnr9x1hfTdK2hb/FG N+YPS9cFQgpiVZ7dtdl/tAKCAH/BZCVRl5uyKE9bVw44ukqfBB4KkUa/3taocQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1667830613; 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=4rGpLRcOY1creCvrfbqnEjYKevj7W16ctfWNljowJxQ=; b=eMtcNfNim/ymbtlno+leS1ndXvplDak5vcnkw8YUVpPhIM1oojFhJO7IXBUaMMuEQIJ3mR WGpBhCUMEGgilwAw== 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 v3 28/40] tty: serial: pic32_uart: use console_is_registered() Date: Mon, 7 Nov 2022 15:22:26 +0106 Message-Id: <20221107141638.3790965-29-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/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;