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: 12912555 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 7DD26C43334 for ; Sun, 10 Jul 2022 15:04:54 +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=EPOxZHcBysh1mX xxadO747dlgco3C7qqTzW4J05Gzm6rKYJG+z4LHlGLuCD+pwrMKKsC/PREFc2Di6MFud1sjwNl4WE Gk7GSdp/+3LehgqC3/rgPcLaLRmA5+bFQQTw1XfR3uLlztdpZiPerRALs1dj+7w2Oqx2R4QcE0GLP th+cLjDjxPTWwPSLkQ2ifRKsznpTp1XHZSRpFgtFPpQ5LoYgdrglUAe134X0jsfvMF/NUgFV4S2OV EiNUR8zDmYOiGOl4Z/aWwc2rlZiIsPRYwR6nUIMzFUrm+dJgyZFZo5B9XhEoXG3hJGCZTyvWE3m34 a12TnEO9b2kEawD8LrNg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAYTJ-00C8DA-AD; Sun, 10 Jul 2022 15:03:45 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAYTG-00C89V-0t for linux-arm-kernel@lists.infradead.org; Sun, 10 Jul 2022 15:03:44 +0000 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-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CPBXRrsNPSh0F7AN6B1Nswtb6313oVH1WNWoJophntkCsGHtaareel161m/cMKuYL8bWv M5J06TFDUCEvOQSvz4ZnAyfbfGW46RxF/NGeYBU5sk9ooUSMX2xOWiTwY62ogYXKEAXzjHJ7Z qB2K7ENeKPXZqMGriOXoR1gQpKYQ2f60HGb/wEtssSH5Q7JjLVrNn4nlcflSp43y9G62Ty3Ab B5YJ0fgSPSWcTxziQJa92TXC1gHvWzmTLbjLij6ZWBvJGERLeGPW2AiUNr+s126b6hm32P41i gvJVdqTWg7SlvhtUP/xtrl3IaT5KVp2+pPD9rfsdw33dko9Ps8vatENNU6KGwWTX8wz69eYKk 0DC0ZmjnA4ZLep2WXeO2gBKxlZtTE69CReGIiK9TfOmj1M4S0pb6Ik6vA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220710_080342_535455_F85B6536 X-CRM114-Status: GOOD ( 11.71 ) 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