Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1943089rwb; Mon, 7 Nov 2022 07:28:34 -0800 (PST) X-Google-Smtp-Source: AMsMyM6xXqzVbmu5ric9fPkDoljSAWhpTzoXbxu3Qi3EmWpPkOZTRnxNl/vLT6eMSkFhfFgFK+DL X-Received: by 2002:a17:906:8a7b:b0:7ac:baef:6de1 with SMTP id hy27-20020a1709068a7b00b007acbaef6de1mr48852213ejc.734.1667834913924; Mon, 07 Nov 2022 07:28:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667834913; cv=none; d=google.com; s=arc-20160816; b=jTviyJ87MyyMaSEAhprRvOwo14iw0Fo4WsuJ6tbdJV2+Deiwz7FM+rxNcxdcw+VLWS rfDiLk+21f6KtgoKFMrpLH+28tXs9Tc4/aOsrZycU7ybEj0vvCoIHSc8gDwx9aPAgzbE QNduM6qapGbZyEGRtnMCoYdELGxMafGeqx2nkqAFxJv6udRZyMVCPxVBRL80Z/XnMQ2f e1qtvdjPUGljtcnvrelaYf+P0jZBG+8cXm0+7g58+ukOfkSAXA6sYXBk6jT9eLcCvAOC xMs6rFH9lxueYwtOZjx6UbrbBPDIpskRAz+aTSQLJ8ygyTQ2JAqZwG3rMn/g11wx7Sw5 vsug== 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=rIFVvGo20s9m3a2ORQZJ6diZh72O0KdKN/vykqpOG6M=; b=QblSDsidHT6EMHfyuSpdTNl3P9q/HAHRHsQPm1khcll5wSpbKQ65aHWgdX/H6ccxhd 2Y76wdREm97ojzF/xpCp+KROVFeYzVM9z3PAI3WxuSswhOOJt/RJcX7BFwKAx4XMIFiz sDUZ2Lw+S+tlc2A2zq7dmRSmUL4MPFE1hJDSBvcMePSOddt3cN2pp9HIl4VFOSkvPZGO 4aOmDAtJRSel/ZEf4VGv2Xr2H6FU53erj37KVEtGBV3M3+BJmF3VCqw2NULFVqwMjJOg 2O1/oJigyZJTrk2E4Vcf18X8EN47rnfoObc/ECHAwNodpHA3i61Lyd1JxgdSb+nPzeWr +Dtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=MZJB5lX4; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=ALG9eKOl; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p13-20020a05640210cd00b00460c36e09b6si8414073edu.431.2022.11.07.07.28.10; Mon, 07 Nov 2022 07:28:33 -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=MZJB5lX4; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=ALG9eKOl; 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 S232338AbiKGOSf (ORCPT + 93 others); Mon, 7 Nov 2022 09:18:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232222AbiKGOQy (ORCPT ); Mon, 7 Nov 2022 09:16:54 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE4911D0F7; Mon, 7 Nov 2022 06:16:53 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1667830612; 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=rIFVvGo20s9m3a2ORQZJ6diZh72O0KdKN/vykqpOG6M=; b=MZJB5lX42WcNqfQf/8Uy4aTmZOi552MX2XYZ5hG9OlguJgac67mF5BEXukX1d+qbynQc/L P13tXHiAAu9wRwaCfqN6TyjkrzUUkQNJA/l3DU53O6LkfVv5tI+qVxI2f8nZUIPn1b5S/E O3beP8Dac2x2r2ouaorlV9viccM6cVWYvKhliiBWguW38a07M6JzMV/CO5GqoyXLcp/hKW jHXOW3VMeEi4kzZGi3VPUxBDKxLeKLxdBzyFBTIAN8V4rNN9ZDGsAaQIH32Ozl5KcV6av/ 7DTDlBs1hTid01SHsrwLPYbWLGGbdYgc/xSMf9EqSBy9atMNjA4uSA1+zIlH3A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1667830612; 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=rIFVvGo20s9m3a2ORQZJ6diZh72O0KdKN/vykqpOG6M=; b=ALG9eKOl3s7Xt0eEnwNoL/F4GKWQMH6+qAGkok3zgVPzcLXBeHOOBayw+8bjy9jYTFLvj/ pW3IJBvcGaP2m1CA== 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 27/40] tty: serial: earlycon: use console_is_registered() Date: Mon, 7 Nov 2022 15:22:25 +0106 Message-Id: <20221107141638.3790965-28-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 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 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/earlycon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index a5f380584cda..4f6e9bf57169 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -181,7 +181,7 @@ int __init setup_earlycon(char *buf) if (!buf || !buf[0]) return -EINVAL; - if (early_con.flags & CON_ENABLED) + if (console_is_registered(&early_con)) return -EALREADY; again: @@ -253,7 +253,7 @@ int __init of_setup_earlycon(const struct earlycon_id *match, bool big_endian; u64 addr; - if (early_con.flags & CON_ENABLED) + if (console_is_registered(&early_con)) return -EALREADY; spin_lock_init(&port->lock); -- 2.30.2