From patchwork Mon Feb 28 02:39:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 12762320 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 8C1C9C433EF for ; Mon, 28 Feb 2022 02:41:58 +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=X9TNI2B106eQdT eHtlNrYRYinQfE2Vg9/6+Ug9kB2J8o40cZr2OuuBjgDSM7k/n53BLcjPAs0vdgqIRiYq/2FcdUrkK Byu7Cf+FAgqjLqvBMl/35m81RXCkGcPAAD0hON84jWJmbV3TcWIzuw3IM/PupnKxzuHRKMaoQDMxq HQl3/b0Cq4yL3VA4XxS3vMVFy6PYDrpV+mGB3hcGVeXDI6wVMdaVPZacXjQj56pD16MZEGgxo2+GW FFWWm/xTre/5YBa/tv/HC/9tYmPtMrZEBSqKPLJQqTVbyvWQBtdHZ3f/sniKh2pN7cCW3R4AcR3i2 1RJroOfsPDFa+xnz+gQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOVxj-00AZPS-7C; Mon, 28 Feb 2022 02:40:35 +0000 Received: from mout.gmx.net ([212.227.17.21]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOVxK-00AZDt-2e for linux-arm-kernel@lists.infradead.org; Mon, 28 Feb 2022 02:40:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1646015993; bh=iPI9Eyd+3C6S85WoH/RH9YiOHOKEC2bR9K+d8H8925A=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=B2rz/X9piz6OIHopWLOnR1oRrBHZcoepl1hpJNpfcIm+OiUYTw6smz/pw8AB3R3/a r55CrB35v7qGgwzM5kYLiE1rHZxQea60z3wcibVZZ3LnzvtzuigJJDCWwCDOGLQ8LQ YSHdfcPMvqhgB8dKcOG5rvMJsaZIEFf+Kd8YvqXM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from Venus.fritz.box ([149.172.237.68]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MBUqF-1nUoGl3ZVv-00CxpP; Mon, 28 Feb 2022 03:39:52 +0100 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org, u.kleine-koenig@pengutronix.de Subject: [PATCH v4 3/9] serial: stm32: remove redundant code in rs485_config Date: Mon, 28 Feb 2022 03:39:22 +0100 Message-Id: <20220228023928.1067-4-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228023928.1067-1-LinoSanfilippo@gmx.de> References: <20220228023928.1067-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:Lr8oCML/RhTrktKji37TkXyhwoDx/xbf6v8vFT7o7L2qTyz8hit oKCSc08BFqYzX5GwZKq9lLExSpUiQhfFLT5EOci7KGo+LUkxPUou2t97Lv1wM3WcyyGZvfV l/91l524sXYL8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UMjWdVP/gHuKCxELS+XjB8OUtDZtP9eWWg3eISU M3xsOA9VELAYVOopFuLdXI+aCo7/qUmuDtUKBbIK8ZA8myTp/x9GeWw6YthWkjjqjTpMgxrE5 kOcaCVY2Cl4g5w0cODFb8K3oB2Dxk5yeq0g5J2/M6ibtuT8YGpku9IyAnP5AM8CYa+ZOSi38n dq7QFOS27y3MB8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220227_184010_463326_37CA8586 X-CRM114-Status: GOOD ( 10.84 ) 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);