From patchwork Sun Jul 10 15:03:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 590023 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 7B358CCA480 for ; Sun, 10 Jul 2022 15:03:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229535AbiGJPDx (ORCPT ); Sun, 10 Jul 2022 11:03:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiGJPDw (ORCPT ); Sun, 10 Jul 2022 11:03:52 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3FE3646A; Sun, 10 Jul 2022 08:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1657465409; bh=hAdqGU4U+jT6aGvJmg4F8iA5nfZQBLISiVM3W5oMaNA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Kil0ihi8CLg1hcV0Bl0c1mDxb2dKaqNRKuE27ch/sIBtNMMhpbYDIn4qMFG63ssip Pr66aA3J5hVV7P+361zFUUhhxJ+wUBuYDisn2e4MXCBQGJwXlO3MR2GiQbuu3E7nbi guDRiovY02jPKO8mWMKhX4UsP0ZwR7BTe0I7LhS8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([46.223.3.243]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MSt8W-1nzzoN2Ps6-00UKK3; Sun, 10 Jul 2022 17:03:29 +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 v3 1/8] serial: ar933x: Fix check for RS485 support Date: Sun, 10 Jul 2022 17:03:15 +0200 Message-Id: <20220710150322.2846170-2-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220710150322.2846170-1-LinoSanfilippo@gmx.de> References: <20220710150322.2846170-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:/MJtYd9AOLMxStE6KfPlSbTQ5/sUlYRb1gizfNtMnSPE2eDXq1d AHprNBtSvZqtfdaik5Wo4jzS+CQRcd8sR0JrpZ2ximJ390D1vM7Ls4jxarMRh5bvIuIiJbG 5wh/GkBARbYtEY4oZEnnS8m+kH4ji1piOcMb2h3qtQEKRNruFc4b1EEG6oNZs608MabR3vQ RpBtHr6OKqkjKlf4hHAhA== X-UI-Out-Filterresults: notjunk:1;V03:K0:SMNcpCrW+ro=:D8ly5GJ6LkIiAGR6E2Lbb9 ZSZWX1ruKyu3mKj7vvd3iada97G+Ma+3yiq90E/pLcwm5DugFkiKMpDgIX6oxn0FYJO5dT//m 5rpuLCwfhJc7PCj9rEBRAdiNYdW/oAyMte2v7S21COWiZCJX5OJBUHBWjk/hl8uJe7SH+jgb2 f0uO7yHOY5Nc70GaBQlYrP+c6vLYYcknHFkd4mrYONjFxRM9NiZE1LQKxSB76SrgL6MEGSpu+ fegmOTBzMfdAAeDPG9zpG8kiv/kzqG8k9+D4PiIFhmjyWBCSTz/837ZdrbAkKlbikNOvUN/Lo T7/Ld7tXLaO7JhLy8N9wUJKg9kty5Dn3uR1ImgH18Lzc6RLiTn++gkDcZJTVdrkYw/QxkGzQZ LVTa+UkrOF8tWiFiLw6bkag1wvPSbazoVMK/wKQogRWXdjfiegUseUlHvMfpjDIcBWT29I0kc CstLM9/uGo43sVNKRj643WT0JEY+YQIQK4VBqYNji2IE/HMFnJZFDn+Lf18QFZXrp9p2WXEwU 3HZ8XLfUXRqXOOoMTcmA5H0NIVKts2m+aeEItZ17Wrrm2DdcqNVXXq6GRaNjFNCjDHaCorr0U ZaQu2t7JeV8gHLzDPLcdQ1WSDjKMg1O7CQhyqoEeby/xatCLTUVakeQitNLbBNnq2SjXgjyoc pXPlZPecumjoeRux+teq6CHAsX3cHPe7ddc1NqWKOtnIYvbJUK3asHL3xbnVvPu8lCE6CIytA 6ocdCPBXRrsNPSh0F7AN6B1Nswtb6313oVH1WNWoJophntkCsGHtaareel161m/cMKuYL8bWv M5J06TFDUCEvOQSvz4ZnAyfbfGW46RxF/NGeYBU5sk9ooUSMX2xOWiTwY62ogYXKEAXzjHJ7Z qB2K7ENeKPXZqMGriOXoR1gQpKYQ2f60HGb/wEtssSH5Q7JjLVrNn4nlcflSp43y9G62Ty3Ab B5YJ0fgSPSWcTxziQJa92TXC1gHvWzmTLbjLij6ZWBvJGERLeGPW2AiUNr+s126b6hm32P41i gvJVdqTWg7SlvhtUP/xtrl3IaT5KVp2+pPD9rfsdw33dko9Ps8vatENNU6KGwWTX8wz69eYKk 0DC0ZmjnA4ZLep2WXeO2gBKxlZtTE69CReGIiK9TfOmj1M4S0pb6Ik6vA== 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