From patchwork Sun Jul 10 15:03:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 12912556 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 81223C43334 for ; Sun, 10 Jul 2022 15:05:12 +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=zP+7h/E9R3s4DH BLrs1q3rxR44VWS3N3WZ083zIUuvWXf/d/0oi0DzAR1sn1nF0H/90GICKIVAd7sAQO6VEThGGSyOH n5I05mPdONmQrSxm56psQ+BoK22gGkJnds7FQ4BO3Db6PTyK8GN0aJFtYnYasHRvfn+b0pUPQH50J 3epOFmIhnlwwldCAxcpFRCXSBCoqHgmmcvsTlDw8BYQh2GIemVfgve79NKgBXyJ86XzlVu8qTWd1z KMPEH8KnqpHi8zwKMx7SHRSxwDUj1x3IbsdgtLUcGVqfkBqU85oI+eLnN5os/3v2fifzFykRUJ5v2 gaoatUoDokxc42B8ShFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAYTb-00C8Ho-3w; Sun, 10 Jul 2022 15:04:03 +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 1oAYTG-00C89g-DQ for linux-arm-kernel@lists.infradead.org; Sun, 10 Jul 2022 15:03:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1657465412; bh=RTaQ8P1MotigS/r/NqnxH6+EynGn170u76xP3S9I5PA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=VYmgRHD9guwyTr685kbRDCBjTxEvllfCEKiU4vomDHEk0ZWjDSho4zlby82R9EouY e37GubREDnBIVqtKTwMivFON9fgTUvkj7nTpVzSdajq9b6lg/+4D/8CVdY/6QPv7cO 7V1WXAt0fg82zgiV4E5zlUdjfWz+Luu8B9NOmypc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([46.223.3.243]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MD9X9-1oJb1h0oxF-0094ya; Sun, 10 Jul 2022 17:03: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 v3 7/8] serial: 8250_dwlib: remove redundant sanity check for RS485 flags Date: Sun, 10 Jul 2022 17:03:21 +0200 Message-Id: <20220710150322.2846170-8-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220710150322.2846170-1-LinoSanfilippo@gmx.de> References: <20220710150322.2846170-1-LinoSanfilippo@gmx.de> M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tJbWBLnx2E8yPYlJckLRL27udNBODn2w z5wirR/xGrgkfcmolIfILEWEsjTkNg0vQBeDC6cmTqBlItlt/ih8xNIi+ADeTSK84yvRscJZP Nx6ZzNrH/Uw8odj6uIbKO1dSXz6sseT0MA911MbR43kNtXJIApKpVfPHDQDDOIz75XmjcsKFZ 6cBYQejyIIFsXG3ANhzuoZl6RhlmBSDcpXZE4ksqrh3j3VtS7piAW27uCE/zNDyZa0VNURC6v K6Hacxu+bBExQphZoPC9j9etDejiOUBN9Sqh9v/Ez9HT614UBz1CKaaXox+rtT15GtqCZZGwg b6ClXKMqR6wWD9rchb8ragRm/25uyl9PTviFVobAmTmCYQTunH/+h9OvQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220710_080342_796148_9004DB66 X-CRM114-Status: GOOD ( 12.54 ) 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 {