From patchwork Tue Feb 22 01:14:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 12754393 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 639C5C433F5 for ; Tue, 22 Feb 2022 01:17:59 +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=wq1Z44g4TA8Ji68D2/UuG8N/7/MFq8O9xufflTwot9o=; b=GMum+lz7x+g/Sr FptWtqEclK7/4rjyu4GsjCxcFve+vo3dfT38yf2+LrlJ8l8LPAtqngympnggJB2IwUpIGMdH8W/Be xwGDD/rlW/pn6DKNtKex3l/f0N7/LQrfLVo1tYLhwVsGO275m1cJdCj5Kz2e6QlQaG2MI/+aZRaTo HZXX77YFHgqykXaX3w+/A6Gh/J+3tnCcONMWqUByiOBdOh660FIvmJ4eA3n7GJGtfEfMdQn2WOrYM lMNAH5KvNfPJ0jp7h7cF1uOejUT7FvBD9PDTmdIGOXtNGXt/1lN/oFgqFWKpx5azEbyNOEkMljF4W EeQYCFRBHVU1zxqfV29g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMJnE-007al1-P5; Tue, 22 Feb 2022 01:16:41 +0000 Received: from mout.gmx.net ([212.227.15.18]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMJm5-007aMX-Il for linux-arm-kernel@lists.infradead.org; Tue, 22 Feb 2022 01:15:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1645492508; bh=iPI9Eyd+3C6S85WoH/RH9YiOHOKEC2bR9K+d8H8925A=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=jjT42f6heZiJwoGFdqhGVNEsThg3FASN9KHgvZ82tGkVa01YSvpMnI7qFnQoX0401 d7c/u/kromWD/RY+B0UKGLmRhORjvzkJ4zs7exioVzkNWMO7NVWIdUnjffL/9FMWfP IbBJOINbX3DOuEXrkq8nH82EZTINm2KG7jOJwXbM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from Venus.fritz.box ([149.172.237.68]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MMGN2-1ndRTm0MWk-00JHRS; Tue, 22 Feb 2022 02:15:08 +0100 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org, u.kleine-koenig@pengutronix.de Subject: [PATCH v3 3/9] serial: stm32: remove redundant code in rs485_config Date: Tue, 22 Feb 2022 02:14:27 +0100 Message-Id: <20220222011433.8761-4-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220222011433.8761-1-LinoSanfilippo@gmx.de> References: <20220222011433.8761-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:Yr0zSx6AgYnin7QmZqOIPPMUBfNDEjL9oTFYL5o617rgkNvXuDB hlhQpzkCAQ+uDw+7QhFXeoWxgexLrBgiOLiyof+cafoviC/NV7CqNcO6MeEYhWkiopEYsuQ yqARWg2J5T9jbHbUp4UFulMt7F3N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FOetRLlrhGSNeOUO D+CdlP+aYvqypGXw7CGnIMJ8RdLNKEIOLrlTUxq6iYg6gEu8sDDQbY5K4z2pmSLZXzKtAxjKY 9X0H1WXHKoSVcnQIJEo2Eiz6fZjohQqfClAxXADR2+e5N4jc0aDtVUh3ErcoAZwHLDfQZ315x X6diRwpdLWdmow= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220221_171529_960543_02943D5D X-CRM114-Status: GOOD ( 11.91 ) 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, p.rosenberger@kunbus.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In uart_set_rs485_config() the serial core already ensures that only one of both options RTS on send or RTS after send is set. It also assigns the passed serial_rs485 struct to the uart port. So remove the check and the assignment from the drivers rs485_config() 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);