From patchwork Sun Feb 13 22:27:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 12744710 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 6DD5FC433F5 for ; Sun, 13 Feb 2022 22:30:17 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gDeUQdm5nY9lREFy9HdSmsCkg9HDlOE2hvXPGxT3/i0=; b=rRuEnI8AzJcrcw l2SVVE/qT0rm5pdU9U6aQwEUQE91RoVgLvBFr9fpzMBSwy4dXCEEg4ZJ9VJ9d1RX8ibiPc2EA4D/K vtCnktHI8cx7Ws9zxw3Qc9aP7Y0knpgyGeX1qIma7DrcofuwWYci0T5RrDJUpYklj7wsnAG3ORqEH OZq4LM1NW879tLF0CSAQ1tM8oAUNcG+dljUZhM6Y7qkKTP/xPHdqXGKLw8I9tC8PIPV6hMt5rYAKl uth7gNDmJlzqIIww5CGj0lQMGx8c3H9tryOpfFFQudfIVtGSTite8f6aNfjusuEh87EJN5gLmW71N VhalFpbAHiG9L2YnSoZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJNMf-00Ccl5-TZ; Sun, 13 Feb 2022 22:29:06 +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 1nJNLz-00Cca8-Eh for linux-arm-kernel@lists.infradead.org; Sun, 13 Feb 2022 22:28:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1644791286; bh=u821ZeufKC1vgSSd268mPpvvDOICAs/3gToqbHdVQwA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Lt1rKs6vV0DZwnmV3xwwtQf7bHV7mqojHYze30QJ1ujeUXZ6C1L629U1eLWJ52rTd +Oexxvoi/iPn8VPB+PF2oX3YeLc14J70XmtuViPAGc2D0VzfeI/dEJ+xD9qxYaIkrh YHExK1fIv8gEi5ro76YORs1w51HwlnjKzyG69uV8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from Venus.fritz.box ([149.172.237.68]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M5wLT-1nLsS52Jel-007R7i; Sun, 13 Feb 2022 23:28:06 +0100 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org Subject: [PATCH 3/9] serial: stm32: remove redundant code in rs485_config Date: Sun, 13 Feb 2022 23:27:31 +0100 Message-Id: <20220213222737.15709-4-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220213222737.15709-1-LinoSanfilippo@gmx.de> References: <20220213222737.15709-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:sRdxeSRpCIAmn+my6vWuOVRB84leThgA0NX64DL3hpPO+tdh91W TkrXZLeAshkj2yoQmJj3uD2KRkZruMzX/KMtxlhgSTzxJltILw8O9ZQgFpHE2zqSjLW0fkw 1ZyhFd3k5xZEyeR9yC3h5LyinJdGCylV7yxXM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QhZQthkQNsqOrZOtifEpkl2U43R4njR0CyAlQtW2CLOPShFnl9PA3LVWOxiqHzOanTBlYDT KpBGFlkX0hKgdI1eSZRcSYLVRGmZYwc1kiLb6FGXFqAROQlASKZGcsA3bx0T9BlBABvYCZlvL drqj3+91jVGWf8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220213_142823_836534_5B6EA8A6 X-CRM114-Status: GOOD ( 12.24 ) 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: , Cc: linux-arm-kernel@lists.infradead.org, alexandre.belloni@bootlin.com, mcoquelin.stm32@gmail.com, Lino Sanfilippo , richard.genoud@gmail.com, festevam@gmail.com, s.hauer@pengutronix.de, linux@armlinux.org.uk, alexandre.torgue@foss.st.com, ludovic.desroches@microchip.com, lukas@wunner.de, linux-imx@nxp.com, kernel@pengutronix.de, linux-serial@vger.kernel.org, shawnguo@kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When RS485 is configured by userspace the serial core already ensures valid RTS settings and assigns the configuration to the uart port. So remove these tasks from the code of the drivers config_rs485 function to avoid redundancy. Signed-off-by: Lino Sanfilippo --- drivers/tty/serial/stm32-usart.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 1b3a611ac39e..6a014168102c 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -107,8 +107,6 @@ static int stm32_usart_config_rs485(struct uart_port *port, stm32_usart_clr_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit)); - port->rs485 = *rs485conf; - rs485conf->flags |= SER_RS485_RX_DURING_TX; if (rs485conf->flags & SER_RS485_ENABLED) { @@ -128,13 +126,10 @@ static int stm32_usart_config_rs485(struct uart_port *port, rs485conf->delay_rts_after_send, baud); - if (rs485conf->flags & SER_RS485_RTS_ON_SEND) { + if (rs485conf->flags & SER_RS485_RTS_ON_SEND) cr3 &= ~USART_CR3_DEP; - rs485conf->flags &= ~SER_RS485_RTS_AFTER_SEND; - } else { + else cr3 |= USART_CR3_DEP; - rs485conf->flags |= SER_RS485_RTS_AFTER_SEND; - } writel_relaxed(cr3, port->membase + ofs->cr3); writel_relaxed(cr1, port->membase + ofs->cr1);