From patchwork Sun Jul 10 16:44:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 12912573 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 321E3C433EF for ; Sun, 10 Jul 2022 16:46:36 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5KDB8B59F3SZtaKJtsmhoTEK+ikiZHz941jgkMJ6lNw=; b=Ety26F8+Hj78xs 05oC2Fmd8Bca18LzP2y6CROTOTGiJv0u5J2pn2bmfjbE0VQTEdZw3vYNFTVyLzf+m9V2oYnt4W1Px +0us7RQdKtbVb7s479EUZo98zJTelB+0TZ7x5Z4EXIFaoroOO6V/sKJUDTzpdifVajOJidgmmB/x+ 0hBQ70yndpRUK7XleVDx78R5+uK1fValj/NqHuNNkKBRHCPzM84S3YEzr7LEMCrx/HEQ1Un24GRYu XvrxYYpXE6dieOYRAJzLSF9q830dnCdX67sevmdsj560UtuDM5hmWcsnB1ewn5abdlLzeT6XaWvbF pgmVhr7RFY8VjdIz3wwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAa3d-00CXJu-2V; Sun, 10 Jul 2022 16:45:21 +0000 Received: from mout.gmx.net ([212.227.17.22]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAa3P-00CXCu-J9 for linux-arm-kernel@lists.infradead.org; Sun, 10 Jul 2022 16:45:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1657471498; bh=RTaQ8P1MotigS/r/NqnxH6+EynGn170u76xP3S9I5PA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=JxeSvcSdkqv3BaJH4LQDBCT/fwR0ffuhsG6H+xYLXBynkukG8JsFoH8x0T2x48uR3 HUC1ebF5Qjtr2BTZIqzOqi1BrT+HhJgYPYGwNl/DaDT6Hn3SISZBDJyxLhCBQH/zSX Rq9qBS61DGAHMVVjueTDJYDXdGJjdOq9/6sbi1w8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([46.223.3.243]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Md6R1-1nah8T17MR-00aANz; Sun, 10 Jul 2022 18:44:58 +0200 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: ilpo.jarvinen@linux.intel.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, andriy.shevchenko@linux.intel.com, vz@mleia.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, lukas@wunner.de, p.rosenberger@kunbus.com, Lino Sanfilippo Subject: [PATCH v4 7/8] serial: 8250_dwlib: remove redundant sanity check for RS485 flags Date: Sun, 10 Jul 2022 18:44:41 +0200 Message-Id: <20220710164442.2958979-8-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220710164442.2958979-1-LinoSanfilippo@gmx.de> References: <20220710164442.2958979-1-LinoSanf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8APCgVwn4Lf15zQB86Iniehx68QHn+vwTME4NnoJc1DcRl7HaLbDvtG+vV PTi0rWed9UGIKEiQSNp8r2n4J4Cos9OGXgHBnn5zj75Kf5oKqMZ/YTdCrAokiB49YJE/CBLT9 y2IZxraJ83kDHN8aOHF1LrkH2WbTJF5+AsYGHZcklN+3XdYMP6dy4LOheIlRIm+YlwPskAJXJ /09tbze74OP9vRymiRX+DZAUX+Pfjb366grrcCAt97FysnPnvW22uZDLz0ildP46DWt1Ukv8M 0WDI6jsAxV3K9aoVW5h9+BnJzKOGPgiYFdr0CY2qDurPLeSt3SU/5PWwPY/enuSgyDFUptANK 8IXP1W3Nd6m8Q6HUdkqHRDawtPzSYOHkgMjHrxqYe1NW1EM2Ko5fNzMfQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220710_094508_082925_D5AB7CEB X-CRM114-Status: GOOD ( 13.17 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Lino Sanfilippo Before the drivers rs485_config() function is called the serial core already ensures that only one of both options RTS on send or RTS after send is set. So remove the concerning sanity check in the driver function to avoid redundancy. Signed-off-by: Lino Sanfilippo Reviewed-by: Ilpo Järvinen --- drivers/tty/serial/8250/8250_dwlib.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/tty/serial/8250/8250_dwlib.c b/drivers/tty/serial/8250/8250_dwlib.c index 2c3b1468bd88..dbe4d44f60d4 100644 --- a/drivers/tty/serial/8250/8250_dwlib.c +++ b/drivers/tty/serial/8250/8250_dwlib.c @@ -187,16 +187,10 @@ static int dw8250_rs485_config(struct uart_port *p, struct ktermios *termios, if (rs485->flags & SER_RS485_ENABLED) { tcr |= DW_UART_TCR_RS485_EN; - if (rs485->flags & SER_RS485_RX_DURING_TX) { + if (rs485->flags & SER_RS485_RX_DURING_TX) tcr |= DW_UART_TCR_XFER_MODE_DE_DURING_RE; - } else { - /* HW does not support same DE level for tx and rx */ - if (!(rs485->flags & SER_RS485_RTS_ON_SEND) == - !(rs485->flags & SER_RS485_RTS_AFTER_SEND)) - return -EINVAL; - + else tcr |= DW_UART_TCR_XFER_MODE_DE_OR_RE; - } dw8250_writel_ext(p, DW_UART_DE_EN, 1); dw8250_writel_ext(p, DW_UART_RE_EN, 1); } else {