From patchwork Wed Jun 22 15:46:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 584563 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 B14BCC43334 for ; Wed, 22 Jun 2022 15:47:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359520AbiFVPrs (ORCPT ); Wed, 22 Jun 2022 11:47:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359494AbiFVPro (ORCPT ); Wed, 22 Jun 2022 11:47:44 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E10EB3D4A3; Wed, 22 Jun 2022 08:47:43 -0700 (PDT) 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-LinoSanfilippo@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:Hhv7t15Eh6FTG+Idf1JKlreiNJd1OLyuJVNyAobctRorPGG09eB UhUhe6n7MDFCBmzjH7Cn5SP/HmdAMOH/OZ48WDsdTRdcLnINiFwqpzfo1IvmwwAFDVNMqq1 8mh7tVmlaIn7JlvTneV+7JF90o0FRhA/oAKgU7uDQpr5zY3vEok4j2ldH0YchU0Awq0Gpyp olizn3mofXHuiEJpSRiiA== X-UI-Out-Filterresults: notjunk:1;V03:K0:uV4EiirzX/k=:tzUAkIh9Yxc0fagdAnUphy iyaTAnKFLbOzbmLlEZMC0tV3E93zqEGVbaASD1I4ZH0m1QsQDiFesL00LqnzCyeLugbm2g/1H tOS/+Aka+/QDu7leK5WD1gZI6mgoe0nNEghrJAPMDpvLjd3keHMDQzkDQDtxEyIBBP+OQtmuw kSfmXSIHM5wWOSUgLxGZVW0lBmr8ykW6pF+kpdttijmUJPCaPaYIAvzN/rTZ5bYrgl7NnU98p mfRS5H1bUEyjqRb6dP4slqACQMjl1Q4HvoZSpxFjrbcUg70UHcQSwpIO8Kj2izhJim65/NDWt UNLLRb8JAdB5XHPMjT8EO/sk0HpML0kc7O+72dZcaweHgXuHnoQq5+rUMy5pn9l7VEiIFKibr Nz5YezbJ+9F5/ek6CmlruMTZLOpgsdzlxokuHdoitPYZcET0W06Jc3oh4Ln5j8ZLelfj3sa5v s3T52RxQoreKAv457PzxBqHDag6x6XaYmbdekh/2VCGWZxr6Yn7u6cwL+r6zCdmLEInKjwZgt 3wNKFk7zdrUvuee/pJuACL+8OKh4iqOXHQEJcpPCQwY+WDaUwDRCVL4vD6ur14g3mD6nWZDBQ cqbo9flzA50PSNa76khoJDVkY81Kp4jrG6ZbSh/bV7JCd5bVWkkMG+9oxbljiePGNWfeRcvvv Zl8gvYDBDvu2aqsb5EEDkSUxV0MFRKYZNLIDc1VtrW158GV/2n4qj4RPHZar8MIKm83O5/I9o OTT0lQameMWIJBov8gOiExgBdAtkMq8YJyYU0nl+I+HG7ie7Rrq4LIKr5d6vzUe+c2Ed93mWA 7Oxod68SqB45ZoPjV/L9gxeqR3WI25yCKQLDkBJjd1kwFolF05IoTnBhH0KzaA/Cc2c+Mp/UG uDnAh3X0RZQM10qrvvbQEr2M/6egoYmTH7/0hnC4hhQE9QcwmP0nfvHOy3sMzXnACEDOmpZT/ UjrVtaJVSTjits3L3l4OUGLh5DbqJ+92Zi9zbpB9HrFrLr6fr6Cq0/aKEi/6Pm7mr2qh/HIOa UmguVQgCt4MwKaM156/5A1fwj9oSZG5N18PP0EqheOLR8dmCTMLE0C0WWsuHjJ9StVIBH1k9z CuzzlNJmuYJrV5zGK15YzazLzGfOYNscI8n4BHV3/Jl3AA73UpkweZg8w== 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 --- 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 {