From patchwork Mon Nov 14 16:29:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ogness X-Patchwork-Id: 19898 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2238533wru; Mon, 14 Nov 2022 08:32:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf5+y8en5HgdWnb4fK1p/gtAsBUAydTfxn8ZcGJJKrKbUtXeXUmYJ78QkOg9T7zJY0gffl9M X-Received: by 2002:a17:906:339b:b0:78d:3862:4488 with SMTP id v27-20020a170906339b00b0078d38624488mr10307032eja.683.1668443522634; Mon, 14 Nov 2022 08:32:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668443522; cv=none; d=google.com; s=arc-20160816; b=txUA+uOrmyUabm8UsfHj/BYWtKchB47tWexQ4xzY/wnkEF45pn8v4szwOOQOkM9xL+ BLGXf4/XljAbCH1BhGgx67susRh8TiA/Xi8Ayz2X14cq5AZA4IgjHSwM6ZW84zHT11yW tKiJyWELFI6bZZdcE4KYCYaoT4ptUtBqz1UDHMr0amyMgZd+u3T9MpvoW2hVQ/Ien+ft pdm5sSpiC2lFq1cHy7WiwmgWtDXTbT2Veq8zZoI64gu1hY10Z2LzURJufzA85N+adfLd yqEe0P4u5q7jFr1Z6Pt+XlPNzZIHctnrwA58sJQFIGUIfLaBTFO6q3RlkmW0oXF2wjKN JgYQ== 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=nbT5X3K3M1aoRDkZvMOtYZXlxXMlLSqc8Hp5XCYzckf7p0x1S4kKdkPCAk7hXVH5UR Bq0ZuZ9DMI1U8KBMhIrpiEv4JRRiUE5todg+sIAWtnlkTLGO2lQRH7b+AfZoEGAmtF8O 8AIYlxcWgm8faH/cmpqyhLKjrHtDIvDMJIjSUgR6b3ecGsiZciaXtKi5cpUYpH/kCDgi SWY8QJJByokFqhd4RfU351Xtg2lRgjgAVpmeJS7wFFuAuSyLy5m2hr8UmRjTjSaTuWam VHldubGnEAlwAsbhj0f8IFia/SnhjI53cDQ19CYXdQPpxYbxbHaXGc2EAwHFyTyrcfWK 1vQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="KI/u265x"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=S0O+bhg0; 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 hc17-20020a170907169100b007ae2dfe020bsi8593995ejc.783.2022.11.14.08.31.36; Mon, 14 Nov 2022 08:32:02 -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="KI/u265x"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=S0O+bhg0; 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 S237790AbiKNQbN (ORCPT + 99 others); Mon, 14 Nov 2022 11:31:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237644AbiKNQa1 (ORCPT ); Mon, 14 Nov 2022 11:30:27 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 523B324F20; 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=d6cWj091YR59AcrR/13CETRi+pH3BIcbTfvrd6iofMY=; b=KI/u265xmuLvr6nYRPE12M3LB74Oi9WZ9jjTmAaeaK+kKHpWrekJ8vWFzHf8TWNRA0tj3K xZTn/aUl6CkW7pwtzCHatJsXylMWpalDLTMwCTnZhBOXIveLBQplRtGpmjv+tBfcwfhNoG ypxEP5xN+krsbBrXUI9JfA3HvwfuSoSHQSSbQres2w59iXY02+XbXgPS9d1lT1AKxZsIDh Bh2lxvysNdC0JNEIgBC7CwfCGYolKRWk622Hfg2MIcrWg+A5GAQ8e6JssnHgv+tXS5kx7P u/gQBgdqhhP6s3rI50iH1/wIbm9/5SozuNvdKxYsvJXZnT/VVYKtYpwDnudbkQ== 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=d6cWj091YR59AcrR/13CETRi+pH3BIcbTfvrd6iofMY=; b=S0O+bhg0ej26IlK6PIB9ok+JZdFnLZxpszF0zbQlv9EtIB/DxIisAa9QKXrNrypAhUhALr xGuslOOEe/kHTdAw== 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 v4 27/39] tty: serial: samsung_tty: use console_is_registered() Date: Mon, 14 Nov 2022 17:35:20 +0106 Message-Id: <20221114162932.141883-28-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?1749489835342920910?= X-GMAIL-MSGID: =?utf-8?q?1749489835342920910?= 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); }