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: 12762321 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 DD505C433EF for ; Mon, 28 Feb 2022 02:42: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=uurWa1vdylfIP9I7uCpY/Br70cwbSFyhag06/pY2Z4Q=; b=Dtu7st5SdawOeW qpgaInoRMKqf3X5ch0EVSkKDR1MF++6shoqym76yQjzu5PR3YATZNOtq0yAnA7VjJsN53VhwRtvp1 xhAQq5HLb6w3CJL+vi4QWgW+BfiQt/hIsstJ7mx2ZxZtOD17WtiH3VmTLlyeZMvafdOxnxaa3g2o5 v6BELduNXx8z2pZPfzlNLw8j7IwDcuZQfGLnoC1r4L9/tRHuZTOCDykHpOtoiTisnT5ys3Qv9qIyu 7vTKIh3XYkyQAQ6lmRBcro9flcaTjUUGlk1Z1XzoDVEwFoCy3u/bUYPUVDwhGjhv8Lvji95Cq89M8 9qOSRgBQV9lV2mGugAzA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOVyL-00AZeN-C1; Mon, 28 Feb 2022 02:41:13 +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-00AZCt-5N for linux-arm-kernel@lists.infradead.org; Mon, 28 Feb 2022 02:40:13 +0000 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 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 YWa5kbBtRY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8p5zb8Lm2WYYWlv7+bavO9rGj7w3yDq L1mlMH7iwaFJSl2McvA6CO7XvWz9Vdsr+rCecwWwXc3uH5OBdd45gTF0MeYytAcZNx6W++2rE 45WJ96obHqNSYRUWRd4B2gCgTXUs08KJgtq2Cm/ejUQU1A1bDpAcrEkA4jM4v491uREQcru4c 5BxKbNQwiaQta0= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220227_184010_549386_2DC8DBA5 X-CRM114-Status: GOOD ( 11.42 ) 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 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);