From patchwork Wed Jun 22 15:46:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 12891017 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 5383EC43334 for ; Wed, 22 Jun 2022 15:49:00 +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=wZhcfDPnqkt23q/BJJwefcuQ0oxlRtwhdE9hrD0JB5w=; b=wjuyh6hAKqWxI3 VOGuJSsAEVqp9ombMTPrWQBeN+nrE5KfnM4Zu65MSJmPAmRiEUWs4z/uI0bDAmQlg3YDEmvOBKAXY PKle0e6lEWs9tstvmareS0tm48otxOgHgzEtic2OBUSkEoDa7bZTLa9NM5FBV6381XbUeGsI9GFGY Ha7es8SiZaYTZfhxBJ2aBH4Iozv8aqVkg7XU2bNBWP5yCSmCMy6XrCPP9YNGWiHmYOu/19/KCLbIh PYWwnbzSTVIM6GgTPnq6cRkS2gaJ66k/cNbTPm+jLkD6lqqdgNnYDjxvP+TJe+1DbN+Ue53vZkvW5 oQ5H7NlBEmnsBMH0mEWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o42aC-00BFJo-JO; Wed, 22 Jun 2022 15:47:56 +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 1o42Zq-00BFBu-7u for linux-arm-kernel@lists.infradead.org; Wed, 22 Jun 2022 15:47:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1655912842; bh=HDosJRHefTht65c4ercr1KFDzqhI1YXcq1slYta5z4A=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=gByAjzYHwj4ZyQkpGUFpq2uQ5SMSXICPzeymxulNVo0O4C2dKCaiIZi+rG6f4KwBZ kqX9CZuqhn2odbA+UDyazL6ZKDn+XGECwtULsCVXgMoCVyyxPSIyLVV4eci29hsS2l vsDTHqA+3i07RXKqBrZkCwywtnlFiqHr24HR/9Cw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from Venus.fritz.box ([46.223.2.22]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MYNNo-1o7uUF3WbK-00VMn8; Wed, 22 Jun 2022 17:47:21 +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 6/8] serial: 8250_dwlib: remove redundant sanity check for RS485 flags Date: Wed, 22 Jun 2022 17:46:57 +0200 Message-Id: <20220622154659.8710-7-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220622154659.8710-1-LinoSanfilippo@gmx.de> References: <20220622154659.8710-1-Lin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AtkMq8YJyYU0nl+I+HG7ie7Rrq4LIKr5d6vzUe+c2Ed93mWA 7Oxod68SqB45ZoPjV/L9gxeqR3WI25yCKQLDkBJjd1kwFolF05IoTnBhH0KzaA/Cc2c+Mp/UG uDnAh3X0RZQM10qrvvbQEr2M/6egoYmTH7/0hnC4hhQE9QcwmP0nfvHOy3sMzXnACEDOmpZT/ UjrVtaJVSTjits3L3l4OUGLh5DbqJ+92Zi9zbpB9HrFrLr6fr6Cq0/aKEi/6Pm7mr2qh/HIOa UmguVQgCt4MwKaM156/5A1fwj9oSZG5N18PP0EqheOLR8dmCTMLE0C0WWsuHjJ9StVIBH1k9z CuzzlNJmuYJrV5zGK15YzazLzGfOYNscI8n4BHV3/Jl3AA73UpkweZg8w== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220622_084734_832507_386591C2 X-CRM114-Status: GOOD ( 12.08 ) 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 c83e7eaf3877..bed2bd6b7a01 100644 --- a/drivers/tty/serial/8250/8250_dwlib.c +++ b/drivers/tty/serial/8250/8250_dwlib.c @@ -95,16 +95,10 @@ static int dw8250_rs485_config(struct uart_port *p, struct serial_rs485 *rs485) 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 {