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: 12912577 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64904C43334 for ; Sun, 10 Jul 2022 16:47:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NJpsQsuVvOO5FDrMB5S5kc9fMa0CJvrkn8V9nzaQ+Z0=; b=yJ+qIAOT1tFcKv IvkzEk7Hi6K+dxCa76pjqQXbGMMrjqt8q8xubFYEEOAUcRLI1gCky45qNXGIN+s2Pd6EU7n6OHnG2 Xn0OgG4l/t/oJyuM1N/yXmiZGmuT98WXQOIHaKT8j1JE5o5t+DtsizYeUEtrMxPNabuGmOW7rxBja vbx44uWR8AyEDDcdOr2rjKToAY/YRrbjRZoFqUS5fajQENpKdV8ygRu1IIgPBHCrf+wtMKOp1creH ETMCFgrBo5UlGm6peRytz26V8eWWkEMdPY5iDk32gdvjZN2XtOWcgAVhkPRb3J/BYkn6qKMruMql5 ZYMyWD6HJUvCinJ1BOyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAa4F-00CXbT-Hc; Sun, 10 Jul 2022 16:45:59 +0000 Received: from mout.gmx.net ([212.227.17.22]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAa3P-00CXCt-JA for linux-arm-kernel@lists.infradead.org; Sun, 10 Jul 2022 16:45:11 +0000 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-LinoS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QDeTK9G6wS05WGx5vcuFFlkUU7zWwQhINz4TNWQvPhUkSJab Kvy+bM5vP2yEZG0yVOa0cdHyuf3UHyLJs1hkd/oeaHw1VrTag+D3SLAU+Yy5werv8k/iSyHBn 7BEIzlujnlPFyxx4lqAeJorhQ2PajoavjjtXC1XHqEBTi6mlksMRMIucKXSXDQkBjUXV2MN6N Feu/M+ACjvY1eNwCcyu2O0hwLh59ZrV0dPHb+SZAUFzIRdADC6EUpoAcxISoZFFyrud8nmb6p tumKGMo/L/7baxD6MAlVEFx7MgQVeqD8UvQxG4UwozsiMUcA02pA9KXqO0i4K5C6VnLfCvu8Z L/mF0qSbKIV37YndJpNVkBex/CtwfRPwZ1dMyhvbacRqK+1tFrnSJZILA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220710_094508_094027_612541DC X-CRM114-Status: GOOD ( 12.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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