From patchwork Wed Feb 16 00:17:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 12747749 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 2D212C433F5 for ; Wed, 16 Feb 2022 00:20:43 +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=HIN1ZP86J1ENH5WYRTHR8QSVs1dadPMyzwSYFkrtBY4=; b=jgpwWa/Qop/+C0 sQsTrBq4MvrSN19nw0/NPDEoHImOcaUpmQXKcC0z6Y9vkj32RA1bI75eSAIvE8NJ8OmgMilS86wBa TFNYYkO01yYryvlm4sZnnAvzb7M1IncG2yGOEgTm7UcSfWdvvwKral5HvjhtO98ucCTpP6dblN7Hn R6WEhrN89pkMlAlkMfgTf1imO/bHWrC9cZ64kh91eymCH1/8D2KUgqBIcZkAT3jShNfH5EVePKsWs B4JhQuwqw2PsqO0JDCMJse6iC0nP/xkbxZIX5EYd9EaExtokSyv7Eme86G81e7MNXUkhuf+xraPDn J4AqI6vNDzhQtiyBY6Lg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nK82U-00509G-Mb; Wed, 16 Feb 2022 00:19:22 +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 1nK825-00501P-P0 for linux-arm-kernel@lists.infradead.org; Wed, 16 Feb 2022 00:19:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1644970722; bh=9fjzLBN+PWaAWLzb25vUWj/J8xwxeq7xuYNRStHQTXY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=TRWqadBfpr7rXZETxXnexOCp6OoWAYSskM8CzJzSwwM4rgEEehYeH93UEQki8dlkm 5GozK644G2TnN/4/WOtHzVm9egbeTz/fJ5ltBzD5OgUSMzWDa9Zyn0MJgjbVLPFhXn FQhIG6pmbAPlxpya9Su+pDVGmegzB7B651sV7oaQ= 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 1MsHns-1o9Ljs0JhK-00thbF; Wed, 16 Feb 2022 01:18:42 +0100 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org, u.kleine-koenig@pengutronix.de Subject: [PATCH 2 5/9] serial: omap: remove redundant code in rs485_config Date: Wed, 16 Feb 2022 01:17:59 +0100 Message-Id: <20220216001803.637-6-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220216001803.637-1-LinoSanfilippo@gmx.de> References: <20220216001803.637-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:/tz633QAQ1FCT4Yf0dg8eH/yTxYQTHHuIgr3F7fDKxaDLTEMWfe 0WvgIa6xZbYzyxJbrmhlAc1kl4UgQlreMe4xgdm6LcjZ/ormhh6Gbj6g1SeFMEkV50vusEg GM3o8gWe8OsYLW7m1QdsliQ+aKaQ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eGW nfq6WbQg9tT7UGeF58rpUHd9QuVAg9JIHpzY9T+VPg4nXBQXCAG9+dINuQQw0nQZ73XDtxUEv Ss4TKSOWU5N6Kl/F/0fNoMTzru6kFCUHKBgil9mralYkoo/GGS0E2j8ToK76EUf0oYEq4Zazt vWM627MxQ6T3LM= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220215_161858_149339_B4E6AD21 X-CRM114-Status: GOOD ( 11.24 ) 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 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);