From patchwork Tue Feb 22 01:14:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 12754394 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 21894C433EF for ; Tue, 22 Feb 2022 01:18: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=lK4/7dcAhQvofEwvrGgEx1xYNikjHNmAxv3n6o66JeY=; b=jWhSelKP0fqpCq YQz+HnqgtyiTIXH+I6C6Pp9o9kKlz5qGmU8AtN5rGCs+G79uOEfb5Dp7cmVjlzseHXZBaU3Q0yZGY vdjjiduRkXW11RXocjfQEVl2T/YL41bru3DG2Ee8YnzulLbvLLXsvyeq0IoXPgnkrHP0FHu87lerP /g4borZGKK/naJyeozPkKdRflh2TO6CB0VNE3GqQPfPL2DzaFWbLWrJH1EH3WV8r5sRuXJVyt7OvK xJ85mtF0rP74giV9InKfe2YEjwkaxODHED4g249fM/7qN8nVPOqQStXAIbPB59D8keM7ed9HLN421 JqND7hSayVOQYZ7USa/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMJnV-007atF-Dl; Tue, 22 Feb 2022 01:16:57 +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 1nMJm7-007aO4-2u for linux-arm-kernel@lists.infradead.org; Tue, 22 Feb 2022 01:15:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1645492506; bh=VqDtjCu1On8E90PP+zcmUBiCFF/DRJ7DnsmAzRfKwqs=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=RNrqn3EGfsrYU7qAwyec8yYuxacsBA3JJj2OSnWGScS2QimbzXLMIK7d2XTnPvzz1 e/EoyrF7kRS915ouO1baNbEwCZptCjFGttoiweCVHkqTyEwUZT/YSHjb8071UQUelS 4sUmoFj15lAavtgtD+p2fNSomniGai4/LanotcWo= 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 1MiacH-1nqy1F0fOZ-00fkCh; Tue, 22 Feb 2022 02:15:06 +0100 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org, u.kleine-koenig@pengutronix.de Subject: [PATCH v3 1/9] serial: core: move RS485 configuration tasks from drivers into core Date: Tue, 22 Feb 2022 02:14:25 +0100 Message-Id: <20220222011433.8761-2-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:SSsn/0UwWR3j7W6KX8VHiJO40uYcDYbhSEf6Uj+6iT5yAPMPiY2 DRtOInCigEKQmPnoKe2o/eI4N3ft3SFBNYY3rzbb4FqEShSJSAq0ZJut4p2B0+uFtki9HY8 O0g5SqO8bnSG9ZBK6IjSfYw6ZOxyTP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3weNt2ojBUjN69/ruP/olavuzCwM6rTHIP2Cxs18Y0sez3pJ2Y8C/WjHfoEv1X137lqqYtU/y lDX9d5l2FF5JPbcoxhCfR2ZAE/0HFr/Ybu0r69Uy9S/sqKX+r6JHmbifbguik2kMjy6jlHDna aAaAUmlkxhxbYM= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220221_171531_459916_7ACD2EB3 X-CRM114-Status: GOOD ( 13.53 ) 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 Several drivers that support setting the RS485 configuration via userspace implement one or more of the following tasks: - in case of an invalid RTS configuration (both RTS after send and RTS on send set or both unset) fall back to enable RTS on send and disable RTS after send - nullify the padding field of the returned serial_rs485 struct - copy the configuration into the uart port struct - limit RTS delays to 100 ms Move these tasks into the serial core to make them generic and to provide a consistent behaviour among all drivers. Signed-off-by: Lino Sanfilippo --- drivers/tty/serial/serial_core.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) base-commit: a603ca60cebff8589882427a67f870ed946b3fc8 diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 846192a7b4bf..2b3afe038c1c 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -42,6 +42,11 @@ static struct lock_class_key port_lock_key; #define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8) +/* + * Max time with active RTS before/after data is sent. + */ +#define RS485_MAX_RTS_DELAY 100 /* msecs */ + static void uart_change_speed(struct tty_struct *tty, struct uart_state *state, struct ktermios *old_termios); static void uart_wait_until_sent(struct tty_struct *tty, int timeout); @@ -1282,8 +1287,32 @@ static int uart_set_rs485_config(struct uart_port *port, if (copy_from_user(&rs485, rs485_user, sizeof(*rs485_user))) return -EFAULT; + /* pick sane settings if the user hasn't */ + if (!(rs485.flags & SER_RS485_RTS_ON_SEND) == + !(rs485.flags & SER_RS485_RTS_AFTER_SEND)) { + pr_warn("invalid RTS setting, using RTS_ON_SEND instead\n"); + rs485.flags |= SER_RS485_RTS_ON_SEND; + rs485.flags &= ~SER_RS485_RTS_AFTER_SEND; + } + + if (rs485.delay_rts_before_send > RS485_MAX_RTS_DELAY) { + rs485.delay_rts_before_send = RS485_MAX_RTS_DELAY; + pr_warn("RTS delay before sending clamped to %u ms\n", + rs485.delay_rts_before_send); + } + + if (rs485.delay_rts_after_send > RS485_MAX_RTS_DELAY) { + rs485.delay_rts_after_send = RS485_MAX_RTS_DELAY; + pr_warn("RTS delay after sending clamped to %u ms\n", + rs485.delay_rts_after_send); + } + /* Return clean padding area to userspace */ + memset(rs485.padding, 0, sizeof(rs485.padding)); + spin_lock_irqsave(&port->lock, flags); ret = port->rs485_config(port, &rs485); + if (!ret) + port->rs485 = rs485; spin_unlock_irqrestore(&port->lock, flags); if (ret) return ret; From patchwork Tue Feb 22 01:14:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 12754391 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 41521C433EF for ; Tue, 22 Feb 2022 01:17:31 +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=f+iI3tb1vjzrodn9AdqM1lVkZEDEcpOXUjE2jKAWSxs=; b=AHRM9La1eAo5C+ maAN0kK5xlnBrBH3TH8ymqsApVIhmE04FZMhPVYfYGtjd+BgmtJBm4elnYlm7tmvPBzI7tgkqi5Au qcXVAkhIazGn5W36bvuuJLLWzr8U6KeJ3NQE9eKEFy7RtjtmPaMc2iR0KpfgAVCRfiz02danpxNpq hmlfgR5cEVo3QjhuywVYL3p549NaB3TSBKwSVN6n774qLuk1/egu/0RbsQUaUNhOfKYRwzmqkZnWI uHX6TitfKRIlcwxwTVcSoLj8TEJhso47iCAbiMxnM7/r25vn3YjW7J8MKVcIggV5hEfsutvD0t8to 0AP6t8mVXfUY4WFh0spw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMJmp-007aau-0P; Tue, 22 Feb 2022 01:16:15 +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-007aMV-Gc 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=1645492507; bh=KEo4sc077TnUumY/3jbiNcL70WXfdFpW/wOHZwtSo+c=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=R321iE05JyltOvTziTJucz7Aha2pQui3BMZ5o3fES3OdohzSi5OMoPakHVdjD1VlB ZbT06e/aqiMoRzYJ3e2aRBl1G3gurFIxguG757H8IySbnvfX3EzmH8GUGjfUokgKe5 cbuUuEOFgTbGukGiaoI8e/pK0msdmRuDy+XckkkM= 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 1MysRk-1o9SNF0rOk-00vtVm; Tue, 22 Feb 2022 02:15:07 +0100 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org, u.kleine-koenig@pengutronix.de Subject: [PATCH v3 2/9] serial: amba-pl011: remove redundant code in rs485_config Date: Tue, 22 Feb 2022 02:14:26 +0100 Message-Id: <20220222011433.8761-3-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:MRCzCFZwVGuHxJ4XCUOnuQ+k6jJA6DTfVK0pMx7+grgupk352jS xmocgmDITGUQJKhjfKpuSW0zwubnakFfr3D4RUaDlmBh7Id8BQ/jPjHYzZS9elgY1WLACnc 7tSOYpKJEnuoHPzUMbi5/BjccZodi+fjg76bLmAZZTVh5U2rhSRFwrdxTleHx83Xu9VKwqr PX0IayxvHad2vb4qRBtSA== X-UI-Out-Filterresults: notjunk:1;V03:K0:AqfelYdZ1ns=:8iaU/xOJxj2wUkOKaGPiZB 8Dd0SAkrmad1IkGQa0bD7nKfMr8BinRUeEz0f5NOlassvDKA/zluwVnWC3a46driuBB2Au+sf Xr0c9VJ+Yh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RM114-CacheID: sfid-20220221_171529_889662_C1A68767 X-CRM114-Status: GOOD ( 13.65 ) 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 - nullifies the padding field of the passed serial_rs485 struct - clamps the RTS delays - assigns the passed serial_rs485 struct to the uart port So remove these tasks from the code of the drivers rs485_config() function to avoid redundancy. Signed-off-by: Lino Sanfilippo --- drivers/tty/serial/amba-pl011.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index ba053a68529f..35c633739975 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -2170,25 +2170,11 @@ static int pl011_rs485_config(struct uart_port *port, struct uart_amba_port *uap = container_of(port, struct uart_amba_port, port); - /* pick sane settings if the user hasn't */ - if (!(rs485->flags & SER_RS485_RTS_ON_SEND) == - !(rs485->flags & SER_RS485_RTS_AFTER_SEND)) { - rs485->flags |= SER_RS485_RTS_ON_SEND; - rs485->flags &= ~SER_RS485_RTS_AFTER_SEND; - } - /* 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); - memset(rs485->padding, 0, sizeof(rs485->padding)); - if (port->rs485.flags & SER_RS485_ENABLED) pl011_rs485_tx_stop(uap); - /* Set new configuration */ - port->rs485 = *rs485; - /* Make sure auto RTS is disabled */ - if (port->rs485.flags & SER_RS485_ENABLED) { + if (rs485->flags & SER_RS485_ENABLED) { u32 cr = pl011_read(uap, REG_CR); cr &= ~UART011_CR_RTSEN; 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 yqARWg2J5T9jbHbUp4UFulMt7F3NS1/U5wcUMZ42ctgEIAmWIfi6xPLQs807ORTkEqgtj57 6wahqPtwNc2UuUgOIbi3g== X-UI-Out-Filterresults: notjunk:1;V03:K0:CglKYrDvqsU=:yLxwhJW99Zwnj5ZRfhd/tF d3ykjhn+uHspulRZ9LdoSS8eRrQfXsW48Zqu5y7LbRHUjqtWsOJTZ7bcDHTCm5Z/feEBZmG9g QTTw+NBMyReQAVYfymSY/X2Nca3LTaUqurSolHvSkNpdq0V0H7bh8KcUuCSM3lVJlzgHW7WBX wrLBMIugfPyIiib7XyW8wPhSyGhjrQtbd5aBOJ+N7Ugxiw+nFHyreDFhM9FLTGckowPmch17X ndYBkaQCFuVU57Suo0xhitzaF7g91xr5W1VFzMuPQpiA4PEe/Uz0A1gp5743pfs7ozDjm9oU/ 5DYjjYj6xXk20vWVew2AmDTpXgfIfz6lFC4Yz0HnVJEQp4e38/kZ0rXrdxkCmP/Z9QoYxSp/v MXwe6KV69iKtBalllBMaLNGUfoWpNG0x8SullFMxnXAzG3iiMAo54EOiyCdEeZZZMRwywPr1j E27AKp0Dx+oKC2frvW2k3uJ35+2y9hqTmTMmezv7fLO2LuzRhwY8BAEQICZCCnSfAsvsIx0wM MDoUndbZ7ynHj7xhVZR71JyHpo2EHZbvPGo+kNwcrLJ/xgB83fK/sH8GH3hqpP8p8V7F/DFKr vhAZVH6T+s9sE/zoqmaoRsD2Pgr9fWAoaCRlH56tr6EFLQA+lR/yXZdVpgXUHVfBfiCwrYcKJ zj74IvsFO4AKWU9HE7IrMsh29j2SbsXMm7xGkN9A1ZSq3Y4kIRRGFt/aa+zkvhtwddehk5/Bk IHilBEYPe+qRnqW1ARDjUev7suh18E7xI/AJNKe7t3d/1MtgDKAv3MHvkcVzkpEwqtb+3crzZ R5mC50LfZnHm5k/dtbALO4DX2Cs1gfiin+nOcxQq1JIWROZcWBb2J9dOpjZAmIV/DCHiIugNB 7PiOcvN71WsaUoOtVdE2MJcTZ9JXhrnl04/ojga6eMhCslBwjfCY7F50zFOetRLlrhGSNeOUO 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); From patchwork Tue Feb 22 01:14: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: 12754392 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 CBA14C433EF for ; Tue, 22 Feb 2022 01:17:47 +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=7Ifj5eE9fw+T38/gLv3CkHWTOYhXb2rzIc2yoTYqiFY=; b=oscZyzeMTc2k1g 3J7L9MwqFQHn9kQXTVkKEq7Uxe6og7v1qZBiTK+0jG04dzVIr1QXVZBiE+J9GjAe5CKzosXSNp1CC XcvUQd0LX71+IN6PzWmRizlm0YzEa24+30TVpZRlhYkDLVQI9em7B1Mn7PY+RKYKfgfq4mYjpPm4o AZQBypU94JFTEZTa46OAhNN1KHOGBzsJiEd8a+5fc4lMs1wWB/LeWSYWki6sZQPxDxWQySOTmCjfF dUE/3bD0A9WVEc6kc8nu1LYabWAOMm2O/h/fbd4BLUhbTkj/2392fy3VbDZJjXNiMECXwz6SFKS7F yy7fs5Gal0+BObESa5RA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMJn0-007aeC-Fg; Tue, 22 Feb 2022 01:16:26 +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-007aMU-Gb 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=1645492509; bh=q9DO7/fg2xOZjFdAWb9ykKHQwvph2xk9kVhhmi9Mufs=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Vcz55CeNnKecxWsY+LSbi5KyAgYWgOUaC+5bzPg02gy6zvnVqvpKeiH5u60J0AOXk PBjuPunYbsTgBiqT0LVTPpOdZ3LWPBvZLg2zeTqIdg89iUX7lVXaK9A8tAibNkNTDJ oUKy8y/xQzO0smKEl2ZsHp2X1IIPlNNLatRLRhjQ= 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 1MdefD-1nvvZM0rVh-00ZhnZ; Tue, 22 Feb 2022 02:15:09 +0100 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org, u.kleine-koenig@pengutronix.de Subject: [PATCH v3 4/9] serial: sc16is7xx: remove redundant check in rs485_config Date: Tue, 22 Feb 2022 02:14:28 +0100 Message-Id: <20220222011433.8761-5-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:tIxe3R5aj/xYwDMk5u7jQ2OEUfwHp37Mnn4DCv39EdTF+0G+o5M pLpdSq4pgFPgrfW4xSi751av18e2KtauIOlv7UXbD/fDH1JN/jTwkEzNbs4iOWcvdgwDnwJ RLIhXw87ndd1GoRidcjfIYjEJer3zgfvim4JrDSLBi6iqMDAOv5LfrgMU0sfbI0rCOz3IZJ ENvjOnwU/p70MF415thaw== X-UI-Out-Filterresults: notjunk:1;V03:K0:Bk6LWvT7BT4=:BslbZxIX6vuRNgXN3BK4wz GLwX5BTmDqY+375EAHBAkqyFRY8SCNG3HQIv/DIycN56bToaVt3oKr/H96sdfNoh/KNEVrL5u o9YN2HZPIPcaABkeSgPrh09qpRVJVgPDZsQJV+ZpsIvmKX9E2UJqdtyA5r1+5BJam9w0zjDKC 0wAEm8nw0Yl6wURxRD4yJ/PiABUMrOS6G5Ap1Rud6HDX7URdOxV/FU5sykaswCEfEIzl88DMa 9vipAjrnxx6aIAQpOG6vDG+kNQ0enb5Bzkt1oK3mL3o4iDRMum7uLb4BJZqQDZKY++5k0mAjt KfSfjnM7HrdukJQPz8Y72R2wysxLE+/AHPdjqSrJPH9Uuf4pFRoye4upP1tGSwdbsXO9+PyzF 1E7TA76PwnAN2WgIWtqPmIdooE0g7vz4dUYNAVvhWZf90rPIvHgEFpF6LGVgjgaW62iu7g/Bx eaCaIBDpTfK/HZddEmoIAsgRP1xrhdxQY+Oky0w9O9UyeyAfYOz0PPavz9wkiOLHshhLB7YMp w2UfoKnP+EZkLSBsd15Z+o9dzY0OnL5KJsrCOjl7XbKeWLaOa7jghJka6+7KJmrkO6g8AX3cC zQDcDWoZwYBJnqMuFlbc5aVjnfEPlzhHEGaLZuYyrM8p5izrwHd8CBSOVDGc7krQxre2Mj6Ye MTQV/TWSMS6NzV2JtVmZghVYrivo4ovqy/tsM284SdIJpXsXgjIvdbahrmAZ1cSJHHAAqN0lG 8zWJSMvu24AU2lQYS4SgOdohZGqh2gaIsM2jZ+J9ckeTymMSB2kF/g7xjbAOD3FAqy+LETPCh WsV7YJwHuy55+eUHcApoxtS2EScjRfX8P/0Befgqnm/lS2XDhPdZDp1wGLBpEJMfgz8N7Bct1 WxI35vzXE4c7XFW7okDJ+WwM6UQ7yUQFRP3nkkJtLY0hgRERYt2S3QpL3GIwlrdMRSaff0vTe CvN0mUWtWzS9VtC95tphM9nXhsvv/cFne7y5oI7JKCyk1kZRGyM8iK2ocYlme0A5yDgzg6Z5V EkAXVwtcRoytlbZ/Ww/RDtkAHM55nIaglzmaD5a8KsNtmROG4DUj0YNt0LrJzTWuNol+4IJGY LkJ3VDMGqDk7i0= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220221_171529_881979_983E0658 X-CRM114-Status: GOOD ( 11.20 ) 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. So remove this check from the drivers rs485_config() function to avoid redundancy. Signed-off-by: Lino Sanfilippo --- drivers/tty/serial/sc16is7xx.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 64e7e6c8145f..730f697bb517 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -959,16 +959,6 @@ static int sc16is7xx_config_rs485(struct uart_port *port, struct sc16is7xx_one *one = to_sc16is7xx_one(port, port); if (rs485->flags & SER_RS485_ENABLED) { - bool rts_during_rx, rts_during_tx; - - rts_during_rx = rs485->flags & SER_RS485_RTS_AFTER_SEND; - rts_during_tx = rs485->flags & SER_RS485_RTS_ON_SEND; - - if (rts_during_rx == rts_during_tx) - dev_err(port->dev, - "unsupported RTS signalling on_send:%d after_send:%d - exactly one of RS485 RTS flags should be set\n", - rts_during_tx, rts_during_rx); - /* * RTS signal is handled by HW, it's timing can't be influenced. * However, it's sometimes useful to delay TX even without RTS From patchwork Tue Feb 22 01:14:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 12754389 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 07C20C433FE for ; Tue, 22 Feb 2022 01:17:21 +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=VMT/XFucqoXuc3Kkfhcnqd/TgYF4+OqzTUu0derb5fM=; b=b5EXJ18eehe1uV 5l5r/7f+ju+8rcN5I2qq1dgZH2wBHt8gBK2wiZmqUQonAjpAiRTofPJM54SyeEnwOwX56B/0kE/L2 BgKYMMNk/IT/1fl/4ImRAPEueRZ0fGAzGacCUsXdTfnr8+alNW75wh68JnJmRChMmgc1X3qaDykOq ANlkiaXVTXv8zajzbmZJFlphgVcjbFad//PGzNN145pCHjdYfKkEifAz0ay1I/f63+01dPLlVEEkR 54M7CPkrZTNbYdpQbEhmmqWNvxHLiI1b+MByFDe7vY/AdT+bqi90CXWly8oeAPJwVDG1+rR8m4BGM GQ9Nwz9ExwSSagBFR0zQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMJmJ-007aQK-98; Tue, 22 Feb 2022 01:15:43 +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 1nMJm5-007aMS-2S for linux-arm-kernel@lists.infradead.org; Tue, 22 Feb 2022 01:15:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1645492510; bh=eHlPTyV9IH6b1xICykBM6gHlY+Gr9tRTW5duy1JBpCA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=eQUngbgwLqLUom8dFWlKScyPSsPcRzNhp2S1l8mr9vwx/IRfkkEPGb3djUohUAC1f l5ny3hweItnNF6kAMqIOdzzTjmarP54tzL1BNNYemiqqVcUeAJQzRDPU5SIPuXWyys SczksCEqxNegmyJ7hjfVOzVPNdeRM28EH9H9bvWQ= 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 1MmlT2-1o3sKZ3XoU-00jv50; Tue, 22 Feb 2022 02:15:09 +0100 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org, u.kleine-koenig@pengutronix.de Subject: [PATCH v3 5/9] serial: omap: remove redundant code in rs485_config Date: Tue, 22 Feb 2022 02:14:29 +0100 Message-Id: <20220222011433.8761-6-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:jbVz0BNPswbOMgeN+DDhwoQBpe2I7vCkKwtO+bMQdX/FHpjcwnH 8mmQEiIsth6jNfR/2SLrMzcaYcWspkmia3HWTqVqCzTIDvE6DLoU2DJS2lwhAeuM4TVnAhw zYpKLPMqM+8TdUXBFfI0fcvgqHx2P5E4tA0/ZRMQvsDikWF+zXfKRqAirrwrgk56ReyTgwP p3+8aUY1VyqdappZfGP8Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:DSOyH+r7gr8=:rgl6X+KkNVZhXNpOmDfJK7 77m3/RGNqTQBAkrsUab0Fz0lqJyPVw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b W24XQav1t/0uRs= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220221_171529_475984_9473EE9C 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 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 0862941862c8..a3afcccfbd96 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1350,18 +1350,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); } @@ -1372,7 +1365,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 Tue Feb 22 01:14:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 12754390 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 258AEC43217 for ; Tue, 22 Feb 2022 01:17:23 +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=MTdCqq35HNPvW1/2epi+Lv07eohvCPprb3Ko1cc7GS0=; b=G2lOPGaWlJFeWc eRg/3wOiem1N3dlH+u7fh5qbj2ZRKo20jr7P08Wv65NvaGCRgtZCjKwEaXuDZp2sL7+ibN+vE5sbR QPqJk7Bdx2tZtxSny+t+/hcEBYf59Paph5upNqKN8iKR1/O2IO+90JGlKMKd6wCtY5vVywF2u/yGk FPkI+nwoFFWE9i5SiGSucKuwUcjqxysPZvooUhHMRl7zJKkAyN11IhIJb8gMyNcmTFi56cPZ8Yihj cmpSfxoxNV3wcZo0pMhusIc7gBxseD9hZTeD04/rzhYvK0d+X4uhbHV5gvBAYMVCL024/bxL7N33Y i+AfzlV4v03z0poVM2DA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMJmd-007aWQ-Py; Tue, 22 Feb 2022 01:16:04 +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 1nMJm5-007aMY-NV 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=1645492510; bh=iSIbiqQY+am1M73zZEjjrGJSzNxevmnnhXm36hRIfqw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=AeyV7Qm6vKSfQKXhoeUcb75P59CSBGm947hqdfZBUF3+8x0Dk9TccuMYRoRHWaaJJ 8Y2IBs/tws3+mtRJRolcpLDMt8YG/+CHXDbhDg4kd5ppeY95IlK9efawH85QjnYP+j GkW7mpqWW7Z7xEU2ZMfLs2Ddi6SzTXRUJNOGDEtE= 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 1MF3DW-1nSrDS1nUu-00FV8u; Tue, 22 Feb 2022 02:15:10 +0100 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org, u.kleine-koenig@pengutronix.de Subject: [PATCH v3 6/9] serial: max310: remove redundant memset in rs485_config Date: Tue, 22 Feb 2022 02:14:30 +0100 Message-Id: <20220222011433.8761-7-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:wKGwZ92bvJ8eZUe5xx6uvTWNLasLSuFKw+u6quzZxtU7poVTk55 j5s9fonP6abJ9aj5k/Sjxn3klkZB8Js5Q0q+3sm8bNDETNs+k5npnVX2gd2LISm9IaWbw6G sLf1UEY4o+wPHOY5D7hkdejw6Ls8wPRst3CS1nOE/zl/1BRfFsi5+zXEU/RMvac4OlA/+b7 rUiTgtWlLCkFRpRlfwGWw== X-UI-Out-Filterresults: notjunk:1;V03:K0:lhyAliQH69Q=:2hUiu6M3Dm94AHqmQ4FPRp ahirSDrA+IJixDhwZQiB0t+u99J1K/k82eQ1OSlPa4jUi8JIvroXaHdVknRxGCmRPP+Ze1X+h QjAfY9vGn+0XjiKMEBlrdO+M8y3UmmiCwkZfabIApB+2u1Ff6i2VgN4PTiDE5aQbT+bsBdgsS +QNf3kvPnPUnHAW7ec8EYxVW32yZp7Jrp8yh1eZoa5wMsVn8HnEoBV02s0diIcfoRGbl0nRZx xpdWGuJzF++IGWPHz29WqEP3VJtUMp5653u76OTxLpzmum6YpuieANHIlOnLtavQeJJDC52aB b1s1v1rm2Fv/Vxvtd7PhHCwt1e03dO1DaUBUL+PIgCTlRS9RB14mZBVq+libkgrdbgtTKMzuw m/aRkORAAv2JOk1zlNqi+QAZdvTHI7/KCaQmNtpllP6HI1lCwsm2O6ZBSUtsJQ5FWaDXtxN+8 BFESbX/RnLyazLIQRRCf6CMhLu0/2ajsapGBvDAYupXIlE7LYvEBo3o6aBb/Xo0ADIg8tgWo0 ReYgPJe/6ib8zbx0CKeWGlqsMy2Jf2Ih3/BqRpLm80E8DaMi7Dgi9+uo7GDToK0OQ++nrmZM6 XZYFu8No3ZnnDR3dpOUju1sAOaZCnn+Tu73AqvuBJmiabSpbrO2k7T5RLIgpLR0aEKt5oRC4i 4emJzgVs8lLyZJY/LjWMHraZTcTS4pZww7jBl1DLOXtlN+mxWeEJ0x0deyH8SAY+ZjLkl4rEP Rw4WAWMy77+qUoWDb79xurw9oqOVP8rEWD4/9NCIzpZ//Jk8EFFaFFW0IbEHQwdv+ezvg+X5x jc4kPLuuMSpd/E94wd3e8FdRTErdjtaunV70arGJKx6j3zzlKU0Mre2J6voR70Zd8Ab/OwSDi xPbwH3KGf+FwQUL14+NIoK/GSkOg9FB0CFOwV+2S5cUpe7uRuO6ZJdFMMmk7ED/RaX2xHcsIY BGioZ4n3t9x8jSUTGR1AWMhv3nKFVUdhwhQMFYt9xWnIP+BhnPcbH0rYCzx77QRNpqxO9fznm 9sUGlz7WzjYqlXmLqE9hggrVqHlNU65er/5l5YV3poCd86/TpB8i6qd3EPGbkGmRqMqW00FAs YuewyqJeGHl0tk= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220221_171530_088166_50F2832B X-CRM114-Status: GOOD ( 10.01 ) 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 nullifies the padding field of the passed serial_rs485 struct before returning it to userspace. Doing the same in the drivers rs485_config() function is redundant, so remove the concerning memset in this function. Signed-off-by: Lino Sanfilippo --- drivers/tty/serial/max310x.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index dde0824b2fa5..2ecc5f66deaf 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -1037,7 +1037,6 @@ static int max310x_rs485_config(struct uart_port *port, rs485->flags &= SER_RS485_RTS_ON_SEND | SER_RS485_RX_DURING_TX | SER_RS485_ENABLED; - memset(rs485->padding, 0, sizeof(rs485->padding)); port->rs485 = *rs485; schedule_work(&one->rs_work); From patchwork Tue Feb 22 01:14:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 12754395 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 6AE92C433F5 for ; Tue, 22 Feb 2022 01:18:47 +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=dsf72w/lx5+pxXikyUJ719yafq6YHoofQVfOZv+7DHA=; b=XKcpCMTd1X6dke qKHTXhPc0JN4hFN3kVRoGc8Po3rMcheHQJqcCDPnNVowd/WDPMbCE+L9PPbYY9jSpHTtOCEbYiLli L6Hrt2J1+6kx/PXKwOGvbu45U6Dkhhtbyb4q7aY01hOUkk6/V7nYpRr+RJj2MhoYH4ZWLpQn7OD36 0yIpnv8/+VaS0+VkODVZDinck1Y/5UYcqYsdKC8NLUGaC2A2ScKXHSzKbvKrflCdwVJSv2wRnsy11 +Jc6pkL+2hvIae+/bW4+6tqLXmxP3g33dQuOTuiv5estYM5q0raVwhfGDSw0qqy3/Vlc7J+9KzOIW 36FHNtSAMCAwAvLV3HZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMJno-007b2s-Bi; Tue, 22 Feb 2022 01:17:17 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMJmB-007aPp-5M for linux-arm-kernel@bombadil.infradead.org; Tue, 22 Feb 2022 01:15:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=TjAcqoaAnmI0l2suIZ3fiCn2gdLnVgDyq5jYOOZmOWA=; b=f2vxPZaz1oDLmk/oBYki2K0+1t EnsYRwBEiGgI3hR8WSmZsSY6mJIUN+HU4miKl+JQw97cng5aPze9+Qj4dMOZ9RMPvTNPoQR1zeWZR NdscxfoAkDWujBdE9Bk+3WS//cqj5UKEjr+S2EuZhcLFdcrDIqK+xdRRAxW50gtV6Up/ozsaTh9em IyEu+k5AGnMZURSoiFXtFmm5cwrIv4x4M+omLfAVwuYAFcNpT2NgGq/IW++ELwNj9sFv8jAGZTgeQ STFI/Rf91eYeGxHxNP+JFBMXerFxdPyur96VZ9mrXgz91LUqG01BHe3YPTFXfr+FuQfxEXZy3yTX/ Byw6fsvw==; Received: from mout.gmx.net ([212.227.15.18]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMJm6-00Bnki-K7 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=1645492511; bh=TjAcqoaAnmI0l2suIZ3fiCn2gdLnVgDyq5jYOOZmOWA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=LTz0z5Gv0OEbNfXEttjpUpY1StURQ43ghgXLj6NkVcjkFCinQ8M+jpRBMV9heU0iO 86BpIdarylbTDMgLwJSzsU2wB5jmx3o/qiHAQBlFmnbN49+XqE4Qzqb7FyMg5pDmkZ TBmzZfptM7cp7slPKH/+TIdEdjMvk0MqhncaeFsM= 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 1MBlxW-1nWB8d0GvU-00CDtI; Tue, 22 Feb 2022 02:15:11 +0100 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org, u.kleine-koenig@pengutronix.de Subject: [PATCH v3 7/9] serial: imx: remove redundant assignment in rs485_config Date: Tue, 22 Feb 2022 02:14:31 +0100 Message-Id: <20220222011433.8761-8-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:1YjX8AGdE1o4xjj2QyZrTsKWKlZdYsaumGzkTXD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vZEW89MB/b/q0t9ZeDzx91zrO99VhCthNPXwY2eS11WAgSZmLPlM k6SnS4Tb7UIEYUyZLljpQfk+Q19zZX1A/7c3hyCfJ7y7TexTLckRuSOHoy+MVwATE6tJQkFE5 5lysybyi2i/7nIOXu0hti1O0ocriMSPc79K58wv9xChIzwzhgkSBbNlcYkZ/wiwWDdwtZqJyQ 209fzvbtyHxIvgTPIPoNNjvDgp06UHSp7i1PCa+zaIKnKvHsPgS91V5Dh+T2ML437GiIq8YHI 0GnWJ42CXehcT8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220222_011530_925457_416FCCF9 X-CRM114-Status: GOOD ( 10.81 ) 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 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 Tue Feb 22 01:14:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 12754404 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 10101C433F5 for ; Tue, 22 Feb 2022 01:19:18 +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=1zJOqyRR47Y7uuKy+hPXv2Dr0/h2p/xBdymlIfiqhxw=; b=4k/nFHbVLoCw42 aDBTOgJGF13i/ljzxGGYNGnuLzdUX1KwWx8nJGHQheF4K8VlsPZQ+cHip9GQMm7B0p6jjGz6FCI0J AFeOB2Q/eqX40rI6YuMYG3o96himzcSkgtWP0JMxEsEyWfOWNkNr5ODX+yvMzxcEG17bsSpM7JmXV pHRPoEKNgs1A7lfLG3JMVP+ey+9pjvyTRXa7KwOO9f+/wOL9Pg0zICa0EpqpLwBGvFXNOI3yr3cF/ PFWvQ8dcCrwZN+V5kcG2kzAqvUsTCoKTmOrZVtGuZNlCRhGESktE6ymulQfRZa8zE9Iai3vXr052O +UUmxf3bPMy2pzb/v0sw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMJoG-007bIs-L7; Tue, 22 Feb 2022 01:17:45 +0000 Received: from mout.gmx.net ([212.227.15.19]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMJm9-007aP0-Mt for linux-arm-kernel@lists.infradead.org; Tue, 22 Feb 2022 01:15:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1645492512; bh=b2y7rSofyMsAlLxNarbQCRJjCqiYzdU9dmvDBfCGMLU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=HHyhmPBXip9YYtenzshreMUrlHEgCwgJ6wWiL/edeehDc1L9FOIWnsma8Bu6uZZyD WkEX/X87zgvOP77rTQKWAm3o7zDefUjJz8HnuJ/nD1rhqTix3XlYzHJDUMyJssIx/h nshou38+ERYs0+EqfKUkYzd49GigfpK6SX/dsj9Y= 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 1MysRk-1o9SNJ303m-00vtVm; Tue, 22 Feb 2022 02:15:11 +0100 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org, u.kleine-koenig@pengutronix.de Subject: [PATCH v3 8/9] serial: fsl_lpuart: remove redundant code in rs485_config functions Date: Tue, 22 Feb 2022 02:14:32 +0100 Message-Id: <20220222011433.8761-9-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:R0QwZ7CNF/l/mRVr+oYB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QLF3xy TD+/+LDL/vZsi+SepeInxHaP1yzcsR8r7OlHicy7xO7mHclozUdbnkKmHgQDoc47l+0us0wB+ UwkAf7bg+5d6r4RINRFrgbySE0XVnBq7lWHJyHpjAUuoKgLyCvAfmfpM1DvcYeQp9iiiL5UjW 4HXjKxQF84bIRqbZbg8XgLD1Dv1CHmH+LbIiDvYhdt1Urv1AUtUH0kyJHzCu1gUu3monwdCoj pyZqFbfcmYieAK4/7HVQFjGYri+JtV30JpBymfzWn98afpf1m3RtLuxJ22RQn6rRrGjmZ1B2Q st6kdOr4Wviz+I= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220221_171534_065338_16B72BB3 X-CRM114-Status: GOOD ( 11.45 ) 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/fsl_lpuart.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 7d90c5a530ee..a201be44d68a 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1377,19 +1377,6 @@ static int lpuart_config_rs485(struct uart_port *port, /* Enable auto RS-485 RTS mode */ modem |= UARTMODEM_TXRTSE; - /* - * RTS needs to be logic HIGH either during transfer _or_ after - * transfer, other variants are not supported by the hardware. - */ - - if (!(rs485->flags & (SER_RS485_RTS_ON_SEND | - SER_RS485_RTS_AFTER_SEND))) - rs485->flags |= SER_RS485_RTS_ON_SEND; - - if (rs485->flags & SER_RS485_RTS_ON_SEND && - rs485->flags & SER_RS485_RTS_AFTER_SEND) - rs485->flags &= ~SER_RS485_RTS_AFTER_SEND; - /* * The hardware defaults to RTS logic HIGH while transfer. * Switch polarity in case RTS shall be logic HIGH @@ -1402,9 +1389,6 @@ static int lpuart_config_rs485(struct uart_port *port, modem |= UARTMODEM_TXRTSPOL; } - /* Store the new configuration */ - sport->port.rs485 = *rs485; - writeb(modem, sport->port.membase + UARTMODEM); return 0; } @@ -1428,19 +1412,6 @@ static int lpuart32_config_rs485(struct uart_port *port, /* Enable auto RS-485 RTS mode */ modem |= UARTMODEM_TXRTSE; - /* - * RTS needs to be logic HIGH either during transfer _or_ after - * transfer, other variants are not supported by the hardware. - */ - - if (!(rs485->flags & (SER_RS485_RTS_ON_SEND | - SER_RS485_RTS_AFTER_SEND))) - rs485->flags |= SER_RS485_RTS_ON_SEND; - - if (rs485->flags & SER_RS485_RTS_ON_SEND && - rs485->flags & SER_RS485_RTS_AFTER_SEND) - rs485->flags &= ~SER_RS485_RTS_AFTER_SEND; - /* * The hardware defaults to RTS logic HIGH while transfer. * Switch polarity in case RTS shall be logic HIGH @@ -1453,9 +1424,6 @@ static int lpuart32_config_rs485(struct uart_port *port, modem |= UARTMODEM_TXRTSPOL; } - /* Store the new configuration */ - sport->port.rs485 = *rs485; - lpuart32_write(&sport->port, modem, UARTMODIR); return 0; } From patchwork Tue Feb 22 01:14:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 12754388 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 4CDE1C4332F for ; Tue, 22 Feb 2022 01:17:22 +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=SgkIIAtWX3gOwBi6cNPwF7GQL8yV+mR5rW7cxzis/nY=; b=nsM7N6YZSMWbmk v0ea6ykwOhaCYdvZEJcsP/jCGumME+VstvQN4E0GhtxYUj3ZlswFB2yMZUKkb0RnZUfA+bG3VkLOc I6+bjxxHqcTd88LiZzwDg7zyVfwap7gZEsLyeYr0RT4HTdc7fxRbMHinZr532A1qqmJaeNrzY3bOg pXFqAiamiQB4Oqu6gpLXScaOtUFyt291ICKjhEX37TgzSR/FUQSkVSL94t+FOBI/pamjcoOgtQ57O wvSc30bWirTG1YsQNH5nFbvqhQTJL2WnOhdxNdkfAv5qurO2SkWEh8lcNl6m2+DT9TT6C+q5VxWhw /jeP+cIe1n6jVIzCPAqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMJmA-007aPQ-13; Tue, 22 Feb 2022 01:15:34 +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 1nMJm5-007aMT-2R for linux-arm-kernel@lists.infradead.org; Tue, 22 Feb 2022 01:15:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1645492512; bh=lEGAOtzgMEFzQKENfjNLVN0s0ToEzWqdhUuUbTO2bGM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=ge/7Uk7V/IzQamDgNXDVZvVyKqd5insicDzvapDhXavvi3qo4FYW7M0nyZDFh+YSj 4Qwj/k0FxGe1jZ6UvIQcW0bLgf+sp3SpexFk6m8CAWRzKw2p3RA3b9gMPBhyHMx+WI kEqu29XU9YXG34Hytbz2bNt/WzYUAx2Mtxjr+PEE= 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 1MiJV6-1nqh301gSk-00fT5W; Tue, 22 Feb 2022 02:15:12 +0100 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org, u.kleine-koenig@pengutronix.de Subject: [PATCH v3 9/9] serial: atmel: remove redundant assignment in rs485_config Date: Tue, 22 Feb 2022 02:14:33 +0100 Message-Id: <20220222011433.8761-10-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:bv2z3mAXWdpqELROOyojpjGAFmvhd9PZYl442nj8R122IfdOqxk 1tQpzRuLC7Fsyr4HxbpC8xSGSSJHPnaHWcP4ketFZsBdZ5ZpmJoJmpMFHvfiTa1YR5BLMzh cfNM0W9I/MenOtYzJSnXNdBIbrdvZCH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GPa2GQJN8YCKf9ttyj3NLv7IgNiUZZPaEcDurG+VkljkOBc8JGChXI7sncidPvV3kqhMr j03vWp3jusvtN4jtqLqWxdnPXXlEz/dA/a/g4lQMK3X9pO2/VKUPh/NktmVkyMtBReul/hzoE DIlSFzITkj95kI= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220221_171529_475183_38DFC1CC X-CRM114-Status: GOOD ( 11.10 ) 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 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;