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: 590021 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B045FC433EF for ; Sun, 10 Jul 2022 15:04:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229624AbiGJPEH (ORCPT ); Sun, 10 Jul 2022 11:04:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbiGJPDy (ORCPT ); Sun, 10 Jul 2022 11:03:54 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 537E164E7; Sun, 10 Jul 2022 08:03:51 -0700 (PDT) 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> MIME-Version: 1.0 X-Provags-ID: V03:K1:EPdF0klEap6nJ86G0oJae4XIa8U0Q/ceU7Qt23QVOLeQ4UiT8uR dmCPatGoEK3YtJWoGzzLM7JIcd/t5f3BvzNKAKILdR3OorSjDYC5tvDkFipvefM2VULRyDj Hz06G7hptyBdRJ7TRci/EhuZIBz0V82nXM7ElZWo5Y++Z/K19LkJVCwnHg7kk2nG8h02ipj MiQJx0dmy4yEGHdL4zvSQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:iEZJw3xE6Ww=:l1Jp2MziPcH061eoQq1b2/ UgUcDDyGvGmWwVxjRdqKA9ncT58txCaqYd7D8x50IpXqm1qTzMXLrzMMyVKoa0lvcTXEZvTD7 9OGtMl9MwuPyejAl7dR+H0odkyIppM2QUYxyFPKnD2DznPkFBbeh29sUbRv5y9Lwx8o6JDFlK ZyjW8/R1IdvY4gWvqAP/uiDq3h6Z718quCceGQto1X+MpYJKk9/anSfbRI9gWy+S5L/cygngp 9UyjGbxr1N2bnvVrC7EF19oGr83yxTcJgKsjZaRYPjEZKilt1KsQyIGFjin/c6FPYBqpfkDPn Zw96lecNyHmzIiMrJAvCd/gPVD/flOoECr1P8prYl1rhqg6oNH/xv1Zp5t1sIbk2RaF6GT01o MKdCc+pDFcYDGPa+eVUEtZpU3Dl3Swz/pmixfW05JoYcH+HfDtQS1cbQgi4hK4vXLk0YHjWug j6r2DS6Xl3Qv4YzFh5PYm/qUQ1jIx6pwYueimMa2CSMeP9cC4fx7wb8lxAvh2kDRltm7OOmIY slejUngqIUvu7kGGxRIDFTT4J7EYheQ4COjlMmo3QN5O+KLM6aS2Tm6zcC0/qquea0NQWMcFQ i60sI5VlwOd6n7O1ggOBu7VQkiqTalqovGtTjGprJGt71jflvYSQGgcYRqVtWEW5vokj2LIne KIKZX1wzeCH45JE9wCN9f12rgbel+xa/xVApMe6sjHYmUpS0y0+5SZeR8xx9nB/hdTVBbZR31 zjMhLW1p5hmFLcUQn120b49GVlZCeSRy+R1njqAkWtJbWBLnx2E8yPYlJckLRL27udNBODn2w z5wirR/xGrgkfcmolIfILEWEsjTkNg0vQBeDC6cmTqBlItlt/ih8xNIi+ADeTSK84yvRscJZP Nx6ZzNrH/Uw8odj6uIbKO1dSXz6sseT0MA911MbR43kNtXJIApKpVfPHDQDDOIz75XmjcsKFZ 6cBYQejyIIFsXG3ANhzuoZl6RhlmBSDcpXZE4ksqrh3j3VtS7piAW27uCE/zNDyZa0VNURC6v K6Hacxu+bBExQphZoPC9j9etDejiOUBN9Sqh9v/Ez9HT614UBz1CKaaXox+rtT15GtqCZZGwg b6ClXKMqR6wWD9rchb8ragRm/25uyl9PTviFVobAmTmCYQTunH/+h9OvQ== Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.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 {