From patchwork Sun Jul 3 17:00:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 12904416 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 BD3A7C433EF for ; Sun, 3 Jul 2022 17:03:38 +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=B+AY5DnSCrp3bfKxfO6zX56idmpUDdKGDbE6kJprDvA=; b=eirmfvHz4g28Ew kq0c9WrSWqUEC0z9YeRJPvKpk6EsBbbromNp9/gDtKDGE/9LvvMZKx4SvUomNBsoIdRS33ngIJ67V gbJwRsfWgVe+EPr4wXyveBEKIjxMh5nAvzzk6JhDGiLA2e2T7ee639XAcPOLVe8O9ss1n9NQ9oatc 5Lqxl2xcfKjz3zzOs0PhEHGsrqg8sfZEYzhPubN/1Qlq9MAm7S8bPw5qHtafpMIKChqfxxdYcmAvt OeLnJLyiFDsePmai+f4iw9N2MGYOBqE1I0FQaOLQV9YFCeY6KLPNZi0s1tkdQlbKu0OtCvTfBPR3f QYo9yAPMPoNfUw1ih52A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o82zS-00HMtQ-D0; Sun, 03 Jul 2022 17:02:34 +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 1o82yf-00HMR7-7D for linux-arm-kernel@lists.infradead.org; Sun, 03 Jul 2022 17:01:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1656867692; bh=Gw9NEaUgWzJlqBYAtK80pixVAewS3QXQKW91nfrstD4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=BCHYoqoDyTIfRPQSP3pz0be+L6Y1yTs6mrMlhnaZnGTDscZFIVEkw8Ftu04175ys3 X3zc7nRc0Po0E5D37M+aS5FkWDUfPVkbhPftmLfWAY6+hApnEq1P2nxfn48dFJngCK J1vXAqZbjgSh0CFbemTj9mVXrrcvMhrEj20bVGow= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([46.223.3.210]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MNswE-1nwzH21HTM-00OH3R; Sun, 03 Jul 2022 19:01:32 +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 v2 6/9] serial: 8250_dwlib: remove redundant sanity check for RS485 flags Date: Sun, 3 Jul 2022 19:00:36 +0200 Message-Id: <20220703170039.2058202-7-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220703170039.2058202-1-LinoSanfilippo@gmx.de> References: <20220703170039.2058202-1-LinoS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HwelwPeiOO7tKGMhr/gdSgzVXzu6+DkK2HdhIj+UJm6A59CicVoy2Q/ Ive5KhtIyJThnK76lqX2UY8xhsPAsdFuyuAV30hux9LDfzD2uC7rUJPQKj9oB1q53PQadaiRk ajcrdDjXxoiCSVH7c01xD2YhIj6ZN4Gc99wA4SjQqKnnaRFkfDQSEV/JI693rI3K/IRWUU0C7 BvW0zP5MGwLrCSN+nu/plLr0Kja7ofBu+nfDfG59AehsFW8yQXowz/SK9MhOQs4Hxis6aMCFM JBE19nyxxniF0+LU9YIqvidZY6jbRkyAU8bWo2Uni8nhZHqeGw5u738Ful3ExGQOVKDoExlGx MeMPq+bgywM2dUWntvAqS7yBBgyHVIcW4iufZGSRwUhcCYHWMiA1eXf/A== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220703_100145_610034_A927E2B6 X-CRM114-Status: GOOD ( 12.07 ) 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 a8bbed74ea70..f4ae262d00fb 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 {