From patchwork Wed Mar 11 09:00:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 214200 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67285C10F27 for ; Wed, 11 Mar 2020 09:00:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 416BA20873 for ; Wed, 11 Mar 2020 09:00:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728339AbgCKJAa (ORCPT ); Wed, 11 Mar 2020 05:00:30 -0400 Received: from mga01.intel.com ([192.55.52.88]:41671 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728255AbgCKJAa (ORCPT ); Wed, 11 Mar 2020 05:00:30 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2020 02:00:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,540,1574150400"; d="scan'208";a="389200226" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 11 Mar 2020 02:00:28 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id E0F0416D; Wed, 11 Mar 2020 11:00:27 +0200 (EET) From: Andy Shevchenko To: Greg Kroah-Hartman , linux-serial@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v2] serial: pic32_uart: Use uart_console() helper Date: Wed, 11 Mar 2020 11:00:27 +0200 Message-Id: <20200311090027.64441-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Use uart_console() helper in instead of open coded variant. Note, SERIAL_CORE_CONSOLE is selected by SERIAL_PIC32_CONSOLE, thus no functional changes expected. Signed-off-by: Andy Shevchenko --- v2: fix commit message to point to the right config option drivers/tty/serial/pic32_uart.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/tty/serial/pic32_uart.c b/drivers/tty/serial/pic32_uart.c index 484b7e8d5381..0a12fb11e698 100644 --- a/drivers/tty/serial/pic32_uart.c +++ b/drivers/tty/serial/pic32_uart.c @@ -768,11 +768,6 @@ static int __init pic32_console_init(void) } console_initcall(pic32_console_init); -static inline bool is_pic32_console_port(struct uart_port *port) -{ - return port->cons && port->cons->index == port->line; -} - /* * Late console initialization. */ @@ -873,8 +868,7 @@ static int pic32_uart_probe(struct platform_device *pdev) } #ifdef CONFIG_SERIAL_PIC32_CONSOLE - if (is_pic32_console_port(port) && - (pic32_console.flags & CON_ENABLED)) { + if (uart_console(port) && (pic32_console.flags & CON_ENABLED)) { /* The peripheral clock has been enabled by console_setup, * so disable it till the port is used. */