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: 546948 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D99FC433F5 for ; Mon, 28 Feb 2022 02:40:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230201AbiB1Ck4 (ORCPT ); Sun, 27 Feb 2022 21:40:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbiB1Ck4 (ORCPT ); Sun, 27 Feb 2022 21:40:56 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1B0F6D4F2; Sun, 27 Feb 2022 18:40:17 -0800 (PST) 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 Cc: linux@armlinux.org.uk, richard.genoud@gmail.com, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, ludovic.desroches@microchip.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, lukas@wunner.de, p.rosenberger@kunbus.com, Lino Sanfilippo 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/91l524sXYL8NTToK57V4ZpiG2plg+RpFsv2TQmMnQi6N3Ot+Q8I8o2Pe+YMZCVCowIlkM Kv3+qEqAJvy4CY8Y4w5SQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:93hJ3foLheM=:31mi6t4gTO0FiQ+HU+tJpE Y5ApMv+V91qhpjpM8p6XwWY6rnTyF8EV/1mzKd2814MgpsFsif1pFJjKjFk+KkAJJAplpgBEp gZZiIlt4+XUnXvlPIsPJfBG8rE9fFnt7T98iXi/fu7ZXViWpjKcrCJN1FoEw9vBimsADRnYJQ LDUAZFYgwnD/ger09u29aj9vdDTDOrvmagFKVcVLuM/maf+V/dlbfaj2LtfNtl/OW1oOC4yhs 3JnhQuWhMXwMJx8OqGp1w3VoTeP/7gOAZx4FVr6vFLsAKW4rDVoOtOnbtxfu0ew7iHiWilZkZ hZvjVjNMnCi/ph2jpLFWfeLWdSzR/8eUvA9zd/f4xgaLY5BBFlC2fZZcPQlkIzbCAhKRAJFO8 BsLpkvz3riLcRvOaAANXNpm6yZl2kVyS/yRn+pdsamctncHw2XiPuUnXJ2yYqmTvASfM1oARN G747mNJGaZ1gk0LHh6qfEyCeO6V0kNfdyWbIxEoMji0XKGBUHf9VDO+X8tx9FIC9Wg8cjT6uY 04SQEdaBvFwlkKvpE1GiTFhSuxIpZAyeawhp9qblDu9BgxnbBTrKmUZQ3sI5wJ1j4HwtWSNPY 4qTdaWsqwWwfHf53lJ2Xtpkg/SwiOtrBPduNftDUrUBlicJOYS+cENHI0aLnnKW4O0vg5EfNO zbw7Fzvuqq5hDrWiHWugKULxY1p1AjxOcFefgZ3E8y5HJUGrHOORueTYV9HFGpFiOECNBmBx3 eHd2dqaMRv94ud9Nj16g26AqmOX4URVwKkdByV+ZT14Kw70V+AZamPfxx5zvaCTmCKAgn0Dqb KAAcaTrwxrNFg1BHB4BTBv7EeHLVWOtL8Ha+S9GYgjrg4z06ZwKklXkJKVAPiP7wE5juP2sOl bVcooI3JRAttvCFMfJKf0wlwXoL03kp4u2UMjWdVP/gHuKCxELS+XjB8OUtDZtP9eWWg3eISU M3xsOA9VELAYVOopFuLdXI+aCo7/qUmuDtUKBbIK8ZA8myTp/x9GeWw6YthWkjjqjTpMgxrE5 kOcaCVY2Cl4g5w0cODFb8K3oB2Dxk5yeq0g5J2/M6ibtuT8YGpku9IyAnP5AM8CYa+ZOSi38n dq7QFOS27y3MB8= Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.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); From patchwork Mon Feb 28 02:39:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 546947 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45BC5C433F5 for ; Mon, 28 Feb 2022 02:40:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232177AbiB1Ck5 (ORCPT ); Sun, 27 Feb 2022 21:40:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231602AbiB1Ck4 (ORCPT ); Sun, 27 Feb 2022 21:40:56 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3927C6D84C; Sun, 27 Feb 2022 18:40:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1646015994; bh=Hex8IO2WpX9Y5fu2wHgqKu6/ZEI0eyXNRweluNBil8E=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=MJmRpAW3ELiY6xmT8V4KIe4FskOUjZzBMr+hm7/cHlIfvw81Qje3192nHowzBXVY9 b5CgdtlH859uTcoXNJ/GyzdvD+/VFlkaCMGoPJlMl8cLbAZMo6I6ICUHRKF0x7BuNn XXli6wwUkLOh7DPRPs9uvruS+/RBnJZ5xe20SR5A= 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 1MsHnm-1oDsRs1Bm6-00tkfi; Mon, 28 Feb 2022 03:39:54 +0100 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org, u.kleine-koenig@pengutronix.de Cc: linux@armlinux.org.uk, richard.genoud@gmail.com, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, ludovic.desroches@microchip.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, lukas@wunner.de, p.rosenberger@kunbus.com, Lino Sanfilippo Subject: [PATCH v4 5/9] serial: omap: remove redundant code in rs485_config Date: Mon, 28 Feb 2022 03:39:24 +0100 Message-Id: <20220228023928.1067-6-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:PzdDhAUBSdMJlshR3Bdzn7uubrZ2Nqrom7Xkdt+5MPDni17JylJ t3FciW6GtSjmf5Ut97Sks6n4utUOydeU7gnjx6v/Yak2RTSJzHFghZKqpi47SGHBhWCzXQ2 YWa5kbBtRYJmUZEJLqtzBlBFdaAQl1vPmh+LQhcxMJQ54sGeiw5aXcLiFBku65BSEC7itr0 VY3LlyMM+54qBAx+XafLw== X-UI-Out-Filterresults: notjunk:1;V03:K0:uHeAU+X1K68=:nK1t7m6GVjwVR6dIW1wsGX NOenbdx4BFVOw3CUbblMN0zzCgag2cOsSj3+6s9anpjScW1azi64Nw/uVkWrRK80ddT41u+8Z jDJsxPKF2R2zKiEZDYXKq7iNP2EAPcpH1+jWkBNg8vdZzfbYkC2mcummtRvqG+E4B4LEF5HKz dmYE9uFF2j5DVF6+UUgW8EWA+bbaVdFYL+mGFCbUxZ8QKa/3u74VFxXr4k3VaiMlsZDy1tGnX 4U6KwaXLoQF6C5HCQDbVOUfb+JIrLbCuzbhQTACnmN036iLO70VHqB4RQlM3iFKCHrg/6YFCT Xv5zDLgv1TkVUEjA44QHFV0sHfTyEovGMJ8NCqzXhnSFOhndSlM22OqqzN2GpUFD44G+HmEI4 k9TTaWBkg/ya0pFqDXonrUDxG+kMrY0Eo6XsQvnf14maIF4Ny1fhvjL7IZlsL7giCE74c7zzW Le5SSzYJmiHs1Io83NQ64upO6mNjqvNuLUqvEBADX3kbjUhBh7iTH8WxlxjmnFzAR+y8kDtAL +PSIHUYwZRD0X4NSPADZPOVrWygAromcdV7UFhji1zh2xTuDTgvj/I75h6YXf0JfVbk7lwhAv WRldHkBP3kNCfTanjM872Y0lXKHRY3EDXXnkoB6Vw5f1Z9XJSo+TalFOQOeIjTlRgeizaXBLZ UW6TQ/Qo5FM7+UX/yfbjN7seeJ40bTu8mb8dEYa+vbV2U2FwjVnM2//t35X/bdqBpmCEAlaFX 2Xqq64WRIfel2IK2e1i4N41FzH5iWbSF1DKEh46lZfhfIuB+CrC4fzjNw67HSwZm97jjANzo6 tTEAwGF+umpeQwHecZoHYIIegu5NaR7DGeD9B+g23dTRXJy3dBFvWFhm2dD3Ac6qBUQx9VtGn BpQ5zVdmyTCkuYH7M9mRmKaSjm4ry+lvKOLk1xhQGQ8p5zb8Lm2WYYWlv7+bavO9rGj7w3yDq L1mlMH7iwaFJSl2McvA6CO7XvWz9Vdsr+rCecwWwXc3uH5OBdd45gTF0MeYytAcZNx6W++2rE 45WJ96obHqNSYRUWRd4B2gCgTXUs08KJgtq2Cm/ejUQU1A1bDpAcrEkA4jM4v491uREQcru4c 5BxKbNQwiaQta0= Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org In uart_set_rs485_config() the serial core already clamps the RTS delays. It also assigns the passed serial_rs485 struct to the uart port. So remove these tasks from the drivers rs485_config() function to avoid redundancy. Signed-off-by: Lino Sanfilippo --- drivers/tty/serial/omap-serial.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index b4e060205e61..15ddaa1fdfa4 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1336,18 +1336,11 @@ serial_omap_config_rs485(struct uart_port *port, struct serial_rs485 *rs485) up->ier = 0; serial_out(up, UART_IER, 0); - /* Clamp the delays to [0, 100ms] */ - rs485->delay_rts_before_send = min(rs485->delay_rts_before_send, 100U); - rs485->delay_rts_after_send = min(rs485->delay_rts_after_send, 100U); - - /* store new config */ - port->rs485 = *rs485; - if (up->rts_gpiod) { /* enable / disable rts */ - val = (port->rs485.flags & SER_RS485_ENABLED) ? + val = (rs485->flags & SER_RS485_ENABLED) ? SER_RS485_RTS_AFTER_SEND : SER_RS485_RTS_ON_SEND; - val = (port->rs485.flags & val) ? 1 : 0; + val = (rs485->flags & val) ? 1 : 0; gpiod_set_value(up->rts_gpiod, val); } @@ -1358,7 +1351,7 @@ serial_omap_config_rs485(struct uart_port *port, struct serial_rs485 *rs485) /* If RS-485 is disabled, make sure the THR interrupt is fired when * TX FIFO is below the trigger level. */ - if (!(port->rs485.flags & SER_RS485_ENABLED) && + if (!(rs485->flags & SER_RS485_ENABLED) && (up->scr & OMAP_UART_SCR_TX_EMPTY)) { up->scr &= ~OMAP_UART_SCR_TX_EMPTY; serial_out(up, UART_OMAP_SCR, up->scr); From patchwork Mon Feb 28 02:39:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 546945 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A449FC433F5 for ; Mon, 28 Feb 2022 02:40:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232725AbiB1ClM (ORCPT ); Sun, 27 Feb 2022 21:41:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231602AbiB1ClH (ORCPT ); Sun, 27 Feb 2022 21:41:07 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 075916E2B4; Sun, 27 Feb 2022 18:40:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1646015995; bh=TjAcqoaAnmI0l2suIZ3fiCn2gdLnVgDyq5jYOOZmOWA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=egzCk6PLEW6jzuBH5Ay/BHf/YLpzdeNDLh12tM+XxnGLr1KoO/+ASW/ya15xBlwIk uK7QE0hBo6Ki0wopsnq2XbMBScFXdndYbFqvzeqUesmYtECIwaLH7blK4Fphd9Y5gD w+F0631x29u0i2hpiGW96sFF+/8GbhKlASgEj1/k= 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 1MRTRN-1navzq30QX-00NTW9; Mon, 28 Feb 2022 03:39:55 +0100 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org, u.kleine-koenig@pengutronix.de Cc: linux@armlinux.org.uk, richard.genoud@gmail.com, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, ludovic.desroches@microchip.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, lukas@wunner.de, p.rosenberger@kunbus.com, Lino Sanfilippo Subject: [PATCH v4 7/9] serial: imx: remove redundant assignment in rs485_config Date: Mon, 28 Feb 2022 03:39:26 +0100 Message-Id: <20220228023928.1067-8-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:OqeMSE2CDGXt5KJ7rWsD/nIkLMTCtETnI8mPAheao9RteHUJGjH uhUD9hHjzAgC5OkrDc4EyFM0mtAdCljBI8ScajPJ1tUtZ4fEtQR6l1gWFFN6dnRMb0kccMF GR8f+uhf6e+oXTukcckXjpiZRFG8gmLRl++cphp+zMyBSerp9tm06LJxhM3kM45hKwJDgw+ xW99kyvyOseDuWzuSDljg== X-UI-Out-Filterresults: notjunk:1;V03:K0:nyG/fLspJU8=:AYZg7QdM2fx5TjQNE4uplA ON0A/MUk4WKpoRdZVavvoFhzMeq4r9Fgp83P5TbqMSRS40Ul1qxFh8lHEZta/ylXkHQSQEI0n 4ohkZ7iB6uxSWHgWgpbNVkKUKuhYMykU57+DkyZOf75Fo6XUB1zmOfCB4J8NwQMQrNtlH0GcB KkeWcyQd04hmw81OYe1zjTQ48W1IR1x+/TwI8JveQFZBVZNBH8BQDUqEbV2/PIsYzR9c4MtgC J/DdVfd5nBvFehz4/2aiRmSU7L6U+ey8V+yZGzx1M/ca/Ns1TfSWQHwkrF+RLdb/WhUbhF57o ZNzS7SW9LZLrhegJO7xvLtyXok0XgwAty+ZzHySFeIeyNL0oBygKHzfwwni4Qhk5QO1lqEk9S xFYrAzIcmZJ6xMkupV43OECEuKDJDl/gcLkAVL/V0IQPrd/HRqeZGfVGcgG5nK1U3p7KEFvjn mfaYUeeXLs/8kvLiuAigW2Z0SGmvipR2g/xPC++De10+OoKyOMAYeOBNmce5e8j3Ep/6njUwr TMVntYKvHbXmBKZO7uJjS1gVE0DUYdsswNYSI9YXroQ8tkDXitRXw8Zu9BebganzvmGDfFvbI M9cSbKjBgnsE+Em5fw58IjJxqCyrmy/A4khElxmIHcbwLQHTLTsyZkDALPk9ya6j2TTzU5dZl 5rXKuQ0N7OYteVeVQ3usQtMSqL+DgkAwIr4n3SWzu4dkGzTPCNJGtTVroet5Awa+X0yKKqJCx GDQ3ks9NTEwmtsUAw5Eju6/bqQ53SDipx+KfjxCqCa6IP29tRImwHWTkiA9owpp2LwDJZuHgq UcjRPh0DZOhC832wOC/qzxBn2ejgbmmCfgvqf5UXENzfPw/b4e0DY6aNNLpCK0h41WXav/jSH opAUEv/HRD3f986FO4Gz1PDp5NVknqKIgUpwW1jJ9QwYpeJ3S0j4QHwmuruLnmSqkdbGI+TBs esIIwOp3QB2Dx6oxS+4IYgaRwDXbQE26AdE0EDLSHW1Z8/KXTkCwBneBvAvL1WMy58EQ5DXJt axykPGwCSZ+zTuhwQPfxkCYd2iGDtzJ2yFcdf1entYTBaSm1rImnribgQ2r14VbxTAkr07Bmi cZbfoChIBaGaUU= Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org In uart_set_rs485_config() the serial core already assigns the passed serial_rs485 struct to the uart port. So remove the assignment in the drivers rs485_config() function to avoid reduncancy. Acked-by: Uwe Kleine-König Signed-off-by: Lino Sanfilippo --- drivers/tty/serial/imx.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 0b467ce8d737..ab56ff23e8a9 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1937,8 +1937,6 @@ static int imx_uart_rs485_config(struct uart_port *port, rs485conf->flags & SER_RS485_RX_DURING_TX) imx_uart_start_rx(port); - port->rs485 = *rs485conf; - return 0; } From patchwork Mon Feb 28 02:39:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 546946 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54A7FC433EF for ; Mon, 28 Feb 2022 02:40:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232695AbiB1ClI (ORCPT ); Sun, 27 Feb 2022 21:41:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232359AbiB1Ck6 (ORCPT ); Sun, 27 Feb 2022 21:40:58 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAF5E6AA5C; Sun, 27 Feb 2022 18:40:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1646015997; bh=lEGAOtzgMEFzQKENfjNLVN0s0ToEzWqdhUuUbTO2bGM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=QLvB8/eHK+/SvsTwtT0eawHbDf2gnk1IMj5JWgZ+vCETZVKmKPM2nuJfdhBfSEZRu bRzvBLKTPZVNZVTLqV/IGZ6bzfPyV2SgNKo2gBSrnTeOeIdMP5ivp1byPVagCOKZ8S A6rVBx4fhRaGZ3u7xjM2cGODqJzdjYREc14QqDuk= 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 1Mo6ux-1o0pd80Sst-00pbxb; Mon, 28 Feb 2022 03:39:57 +0100 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org, u.kleine-koenig@pengutronix.de Cc: linux@armlinux.org.uk, richard.genoud@gmail.com, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, ludovic.desroches@microchip.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, lukas@wunner.de, p.rosenberger@kunbus.com, Lino Sanfilippo Subject: [PATCH v4 9/9] serial: atmel: remove redundant assignment in rs485_config Date: Mon, 28 Feb 2022 03:39:28 +0100 Message-Id: <20220228023928.1067-10-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:YV4KYBkt5vzMrAX6xWwquDgNmwuBCgeR6qBMGU7OtpSXlhEZBgV hsctjceCxGWP8JlM7yusdI+xE38Ji9hhrArnUSILM6GzTNnW/S6iSXrTnTqyfdqwKRI1lv5 G2rO+BDEbqb1V+s8OguTgqmQ40B1DtCvgIjOo17IFLvGAVwD0HUu4DPGrNPkSdrZ0azh2T7 1GtHBqoFveUeOa9p2lVJw== X-UI-Out-Filterresults: notjunk:1;V03:K0:h4UaHU7djQk=:7t0EOHwetVvLoSDwyT7kQP 5ypQC6G1iU+SvNNR2VaSPgp9T0yrtmocNDX/1Ud/Qz9+tFSaoQkGJ1NELIRvmJoMXakodYOZ0 eb3IdiMM+cjtSqr8d1bYBBt4tDgetKjfLhbIAIRH7qAco4QYFadummZjZtjUSCRvpuvyGN7y3 3GIxDs7tXEBPFzrLOcjJPX0qqox1omm9eByXUKifeBb/U44RhCg/jn+sIKPzfzvt6jasXJPW7 RWlzOErH/JJ9/nlbakntOHw/UoLse7D30NHkVsDrhL9rM1WY72B3nP2VBSr0WsckTP2+JxHUk kNddDvMhfU9oIKaZjQCa8eyZNyMPajPNKWHtYaaHmol7byZ8rwagKQq10Q8+ahdJPTRXAsSq+ 7ZuotDHY9eOB/hcnrwrdk5rx8HLFDPF2qQcAtj41AOdum2cWTApdITbgXY2Ivtff3cTkz0DEU DYuzpYWeMKarqjme48FqRuZ60Gk80qN/r9YjFOVOux/OLTIfDWxqBZcDwpX6ZPzvFILkhdE05 oHia0+xtN9CTrj+Q7UItQHRfQsXfFG90aooHaQzVniAK9LeUTC/+DL0z5sWbFhUe8/zeeNHD6 L8ToIX8Z7UTqiWzbWvkrVZhtl8GEuqJWb2JXzLFSbo9CqFUZuqgVEZ3Kn79pC8ETyApVuGxmA T4HAgYu86TGI0ufinZAjKRMRRS9kzeAJBRd8YNyrTpmLbnkh3eSNBwJ8qxtbgcQv1NNRtPAmg k8nSng1DKhTJFDuSW3PHhsMA0CGiIiXkqxYHKTgGHf3gLvAbV+tk5mregVGHVCDE/6TBC8vwc N9cVHsdOnJUR4D4xqb+rtPTRvRUQ6gq0zXsJumebwEZOpW7HbczSQRMh/p6dweI7rDWX5zHMa UCPNi0ap8fCExByFvY6qpUwTSAsdMkPuoOJpxo239wln9qau1TE1NOX3zwh87AvnK9GEkUuxA CXz+tq+pn48xPThCwFUZnTJ8sojmmJURtPDFUlNeY9sOhgzoJOs1SBRNrhf5JDJgjPTjvHMtc B23hTJ/kucecTA5bCBDHjidOzD+w31Yz+HU6ub8sWdwpj0DeJhLEegLi9xYbQ+GhhTINAxTfC zFbNjUzFRJekGI= Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org In uart_set_rs485_config() the serial core already assigns the passed serial_rs485 struct to the uart port. So remove the assignment from the drivers rs485_config() function to avoid redundancy. Acked-by: Richard Genoud Signed-off-by: Lino Sanfilippo --- drivers/tty/serial/atmel_serial.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 73d43919898d..18d3bbdcb7a2 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -299,11 +299,9 @@ static int atmel_config_rs485(struct uart_port *port, /* Resetting serial mode to RS232 (0x0) */ mode &= ~ATMEL_US_USMODE; - port->rs485 = *rs485conf; - if (rs485conf->flags & SER_RS485_ENABLED) { dev_dbg(port->dev, "Setting UART to RS485\n"); - if (port->rs485.flags & SER_RS485_RX_DURING_TX) + if (rs485conf->flags & SER_RS485_RX_DURING_TX) atmel_port->tx_done_mask = ATMEL_US_TXRDY; else atmel_port->tx_done_mask = ATMEL_US_TXEMPTY;