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+8TdUXBFfI0fcvgqH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f+ToFrTWQTgI1RBhGKOp YFaB/r7oEM/Ylo0VUMmVBwdAiQBUjocarplDuBPwaB1yA9wpmVX6ZeG5HBNZrScwlvUZuIRKX U+EhKOdxP71r/3im1hNFIlgfRuvZRCzfa2gir0nmFpDgppqldW3qhWOqW740Gnn4oSiAXi49b 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);