From patchwork Sun Jul 10 16:44:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 590017 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 8D27EC43334 for ; Sun, 10 Jul 2022 16:45:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229706AbiGJQp2 (ORCPT ); Sun, 10 Jul 2022 12:45:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbiGJQpT (ORCPT ); Sun, 10 Jul 2022 12:45:19 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCB7C11C2D; Sun, 10 Jul 2022 09:45:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1657471495; bh=hAdqGU4U+jT6aGvJmg4F8iA5nfZQBLISiVM3W5oMaNA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=OydU4uFMRVmBaBd5ZGwffSMy5f4n+68pgkh7Iiqjos30Zn3ncHGuPs0ndyTNMT3aG sUb7lDfPRJs7yqFGGMUUl/CAbigg5OvLoZO86+8/pSnndhjWjmzS1WoiSsmjuQte1D cqPGIZrV3TUun3qbtv0tC3ckcDqYr1v4ko43weno= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([46.223.3.243]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MdNY8-1nbWLf2Mwi-00ZLAi; Sun, 10 Jul 2022 18:44:55 +0200 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: ilpo.jarvinen@linux.intel.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, andriy.shevchenko@linux.intel.com, vz@mleia.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, lukas@wunner.de, p.rosenberger@kunbus.com, Lino Sanfilippo Subject: [PATCH v4 1/8] serial: ar933x: Fix check for RS485 support Date: Sun, 10 Jul 2022 18:44:35 +0200 Message-Id: <20220710164442.2958979-2-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220710164442.2958979-1-LinoSanfilippo@gmx.de> References: <20220710164442.2958979-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:ZxsMwkh/sJADzwFan2bdA9wzNHS6P+rSo+WssaVRYFj38vGWgMf wVi4wI0mpq9PNuOMR76MsXg2GaYhfAJ/BJ6w4brCMstaprAQrglDqlnfDMgU+rTS5NU+fTr v9Ya3YqcILGefrM0xiq9v9LufwgIo5SIGd9Wtr2NbWsXFOrQj8ejkfcS+r6uXqjSiM6cqQG S9xQzRcpM/PmSDM0XsKag== X-UI-Out-Filterresults: notjunk:1;V03:K0:8guffhWWUw8=:GZ+9TKPh6447V7e/IdCQKx QKHA56c6YekXHaCsl5+F4uBa0nI3RhzQn9VbpMtHimASFnU1BdamhtMSu73ek04baiBexwtr+ EWWQtdyfYLmL5T1xIKQoipZDQb2YDtTK8LXe0b0eIH+sf0DWLGgKKZ0K82K8WT4r3ScFRLhIg u3YDYQjGelsBZFt5+BQwpVgRzk45TOJBeK83X6FmlwK4oViAuA8NiMUPhHd6bX/W8QMiTfeu5 YdgKlATDxQQwIBudiO/SaQqD13yFL3xT2z/A/YoUszLrZUE4lgq2aCX+MjWdpH9ES1nZ+kZBf 0GaSGy9SISLcdUvkJPXgqTCCGhbB3CKvAwaXbNAmynW/SQNijdiPUeypynukdULSIjLFG+eox RyZL1Vhwsg/ycB973Cj0qWjOh65xEz5IHidq1NnmmRT5pePJKFan3vw41uFFq12F6twBW/TmK s+8czWivVkj6COdhKynfLwi03TQBvs3XTbkHkU3mQRBeWaXdhwsT4++xVFVbCN1AuT+0c4o1E wZ1cZr3ORDIR4vK0IRMapz6iRX1cLWDSA+fzpUzIG51YYRH3eocMGLZ1eS1IbZyeZ1ZGI8fBj xN0Rx76lVo4mRKWX4lwd0XbieSi9hDkzZ7kB0ViAHMv1p/g0FG3dcDAXdCa8JHnQcER1QHuta dMrKRNJTa3Ns/ZdopV4tYkEhGYraChwqTk1zvxgdZsVTtdcl+NLb2Mo2xsBC+ANk5kyfGsW6s HfDGgfuZS4wz3eGFiXVm6sMr5QDeTK9G6wS05WGx5vcuFFlkUU7zWwQhINz4TNWQvPhUkSJab Kvy+bM5vP2yEZG0yVOa0cdHyuf3UHyLJs1hkd/oeaHw1VrTag+D3SLAU+Yy5werv8k/iSyHBn 7BEIzlujnlPFyxx4lqAeJorhQ2PajoavjjtXC1XHqEBTi6mlksMRMIucKXSXDQkBjUXV2MN6N Feu/M+ACjvY1eNwCcyu2O0hwLh59ZrV0dPHb+SZAUFzIRdADC6EUpoAcxISoZFFyrud8nmb6p tumKGMo/L/7baxD6MAlVEFx7MgQVeqD8UvQxG4UwozsiMUcA02pA9KXqO0i4K5C6VnLfCvu8Z L/mF0qSbKIV37YndJpNVkBex/CtwfRPwZ1dMyhvbacRqK+1tFrnSJZILA== Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org From: Lino Sanfilippo RS485 is not possible without an RTS GPIO regardless of whether RS485 is enabled at boot time or not. So correct the concerning check in the probe() function. Fixes: e849145e1fdd ("serial: ar933x: Fill in rs485_supported") Signed-off-by: Lino Sanfilippo --- drivers/tty/serial/ar933x_uart.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c index f931ecbc0bc0..f7b4638d69e5 100644 --- a/drivers/tty/serial/ar933x_uart.c +++ b/drivers/tty/serial/ar933x_uart.c @@ -798,11 +798,12 @@ static int ar933x_uart_probe(struct platform_device *pdev) up->rts_gpiod = mctrl_gpio_to_gpiod(up->gpios, UART_GPIO_RTS); - if ((port->rs485.flags & SER_RS485_ENABLED) && - !up->rts_gpiod) { - dev_err(&pdev->dev, "lacking rts-gpio, disabling RS485\n"); - port->rs485.flags &= ~SER_RS485_ENABLED; + if (!up->rts_gpiod) { port->rs485_supported = ar933x_no_rs485; + if (port->rs485.flags & SER_RS485_ENABLED) { + dev_err(&pdev->dev, "lacking rts-gpio, disabling RS485\n"); + port->rs485.flags &= ~SER_RS485_ENABLED; + } } #ifdef CONFIG_SERIAL_AR933X_CONSOLE