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: 590019 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 E1574CCA479 for ; Sun, 10 Jul 2022 16:45:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbiGJQpS (ORCPT ); Sun, 10 Jul 2022 12:45:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbiGJQpR (ORCPT ); Sun, 10 Jul 2022 12:45:17 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EFEA11C30; Sun, 10 Jul 2022 09:45:15 -0700 (PDT) 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-LinoSanfilippo@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:PnpKOWOjc/EdccU37ZkkrSh+yct+U+f+NYjM3bA6D95h50QRPz8 KAZA7zSJojNMW/TCRQ1rgGfTyETfN1kOG5xTYltHvR0AaQWYWuEvsJCo4Tfupd8k2nV1Zy+ mpBhByN4WkFO1MW/QcRyqUwy+/lNcVcTCDIe2p4LbZGIniyQQ5EjSBldI+SpDZLuRc7hQRU mOMoY+aobdAJ3om9Mgvtg== X-UI-Out-Filterresults: notjunk:1;V03:K0:1A5lePXI1Rc=:GEmAi2PBZUQK5JyVPMBAhY bY2LYMVfEqN+KcqXJRhvV72aA7F17Oa5AD8a24WAqoS0UVzKkmrGO7ED+GgnESL9Il4TeZIaT ARE9srLaL8xzAd5j6s+fJffPhm2jnocTvj7SvLuW8/aTIHJbYJXq9pstH8F3o4fkuulqu+Pmt rh+FTilyW+Lb8p+jB8BM0qA61//N1wM0pHV8VKEwh/xVzXTvnOnjXEKjRToBhjlrPo6VsRUTh qDxzwRFOey5prMfxFuSEi7xBm/mlMUL5zk5o4DtPG+isETwgSPLUZEt3/vrdV5vuUWF2ZhwcQ D/d2OknbmtKPYRvA8SlEyEH2ElRx4zTzLVKowI2m0EGNCDE0PJkxJBukTo3UbXNEWgPtfIUF/ gEjKRE2/XxvFq8Epd5wuJ9s3LTMmLXkNK9zWruDkfUQvVbVRUQ8Z1hwkN9lZW9Wve0Y2/deJm Ux57IYWdGS/D8f+Q6GP6F9iWjqEEZaIDCppFJX32cLVidn+r2a85r78gECpgtgBzMq2TF8Q2l DVw6xFAX7MFwZpGiv5zK2LG3hh5uMHtThYt3koH18SPgJjLcpgfpLtlYNxC6MemrqAScbkFrj x7WsFtXDispnw83tWZUs5SlcuDcSlkUw920Zbu5oGQR/ZcCwtsUqkVXFtnQ/M28tFQQfwHr/o 5dIJysy03QMldHKVXXh947CQ6lsEAhI8rvymQSQTey3QNLs9IAoVOmaQiObRNnlWNnx+YSNW/ FgYoaN18DPUtkDV8APCgVwn4Lf15zQB86Iniehx68QHn+vwTME4NnoJc1DcRl7HaLbDvtG+vV PTi0rWed9UGIKEiQSNp8r2n4J4Cos9OGXgHBnn5zj75Kf5oKqMZ/YTdCrAokiB49YJE/CBLT9 y2IZxraJ83kDHN8aOHF1LrkH2WbTJF5+AsYGHZcklN+3XdYMP6dy4LOheIlRIm+YlwPskAJXJ /09tbze74OP9vRymiRX+DZAUX+Pfjb366grrcCAt97FysnPnvW22uZDLz0ildP46DWt1Ukv8M 0WDI6jsAxV3K9aoVW5h9+BnJzKOGPgiYFdr0CY2qDurPLeSt3SU/5PWwPY/enuSgyDFUptANK 8IXP1W3Nd6m8Q6HUdkqHRDawtPzSYOHkgMjHrxqYe1NW1EM2Ko5fNzMfQ== 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 {