From patchwork Wed Nov 16 16:21:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ogness X-Patchwork-Id: 21160 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp233540wru; Wed, 16 Nov 2022 08:26:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf5PTaMbq+W2757I/ijSE8szYg2AOj+DiJybqbKqUBN9quD9LbBBUHXU8Zmwz0K5cLzv0P4i X-Received: by 2002:a65:4606:0:b0:454:228c:742b with SMTP id v6-20020a654606000000b00454228c742bmr20952397pgq.494.1668615963689; Wed, 16 Nov 2022 08:26:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668615963; cv=none; d=google.com; s=arc-20160816; b=unSI5347NIYNuXNlcyfLkZQaaGBkYsSAC3Cr8W9TmfKvDVQdtBCZU/7mySInuvCFWB GVz6i6brBXwpwN0+8yrBMFYsd65bNPBaoLlcKfdIm9XUmuMJhYu3IuVMWL00cFbDVqVw vs1HwkrE18a/d4W7swCJQo0fDhDxU+uEnIW3Q+CZCi49fDnWnvfPdw+oKby0mBQRGIjy vYL8xzxfSdG++Cn9nLtwAwJUqd5+kHcWPaCVji4HHbz0C8qx/76RYKyk024wHEfdB0WK 5yS445z919F5tpGoOpinLFtdERj9fSot6JxhswSqEINKcLQGXOR3mCO/qaIcLdQ6PN2i JR9g== 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=d6cWj091YR59AcrR/13CETRi+pH3BIcbTfvrd6iofMY=; b=ZMxxzN0TOBX1uC18gw14OffHAQ0wB/Oo8kWy+CDO6Xn3XpVwN0xFfpQI0AB2cjiIZf BTuPQHZTaaRItAmkhxsKsWRmF6Y7FE7xjX9qY7t0I3mWjb2OoUnhgvmKyAv1kRcpyZXC IU+ssH+ycolT7taPAVOqMtT+If+9Br1sw4US8KxN7n7I1beY8/g52QSl1HgmF1auIG0z byNHg6ED4c+ctgb73E7GvW7d3MR3VoMuiRKje4aGh7E7u791gmw0IVmCyEQ+B0W94QV7 5qymezwHiX4flZdbMM72elFCaeI/NZFeKcYOaKypHepZrJSIyB0waKyAcyKFeCP7ri44 oMAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3khnPpY+; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=hFnbxyiz; 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 k4-20020a170902c40400b001782a6fbc7csi17695123plk.463.2022.11.16.08.25.50; Wed, 16 Nov 2022 08:26:03 -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=3khnPpY+; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=hFnbxyiz; 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 S238812AbiKPQZS (ORCPT + 99 others); Wed, 16 Nov 2022 11:25:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237515AbiKPQWw (ORCPT ); Wed, 16 Nov 2022 11:22:52 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BD8558023; 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=1668615730; 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=d6cWj091YR59AcrR/13CETRi+pH3BIcbTfvrd6iofMY=; b=3khnPpY+/0fVbClsRREkWs+Q0rzC4dedV7WP9ZYEJeza3chK230FUcVWmGWZWi1f1bhKyB fEyERbPaQyvmfBXggZEKkfr3zRQAv9j8vm+Jm1CSdYHYaUI878LYiSxaZBkgYEdU7VUwZf XTC8wpcneFOj9epONio+fEkm/kmfZRM+BgzHRQ3fYJMoOxhoRulDRrWT5jId6d8uNHOHhc J9yfIl/8aHl5bX32DTboKW286Y8/ZWbtCHcjonQIObk1Fznbhbyknyc68CVCthdwJcVx4O dAbw47J/ZTIxqoSQPE3Lwhm8znog0lnFqpZXChRtuniK/s+a9+v3ETRX6DRoSA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668615730; 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=d6cWj091YR59AcrR/13CETRi+pH3BIcbTfvrd6iofMY=; b=hFnbxyizVoAFtF6UneYybCMMjmZEAsRbkbgOmUKZJnHjqlNXWF0OaEpllQoZiooagRT1M1 uPmVcrJryP7t0XDA== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH printk v5 28/40] tty: serial: samsung_tty: use console_is_registered() Date: Wed, 16 Nov 2022 17:27:40 +0106 Message-Id: <20221116162152.193147-29-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?1749670652763458376?= X-GMAIL-MSGID: =?utf-8?q?1749670652763458376?= 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/samsung_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 77d1363029f5..9c252c9ca95a 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -1732,7 +1732,7 @@ static void __init s3c24xx_serial_register_console(void) static void s3c24xx_serial_unregister_console(void) { - if (s3c24xx_serial_console.flags & CON_ENABLED) + if (console_is_registered(&s3c24xx_serial_console)) unregister_console(&s3c24xx_serial_console); }