From patchwork Sun Jul 3 17:00:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 587077 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 212DBC43334 for ; Sun, 3 Jul 2022 17:02:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232782AbiGCRCM (ORCPT ); Sun, 3 Jul 2022 13:02:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232312AbiGCRBz (ORCPT ); Sun, 3 Jul 2022 13:01:55 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C905E627B; Sun, 3 Jul 2022 10:01:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1656867693; bh=r3dNDUDIuUE3Q0qRG27sRGL8QSUVi1dKmu2o/TP38+o=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=IrAd30hI+KUcO22l6V3kbwW5xHgsijSs1p/i71c27LXUsdMOpa0ypTKskAHkDFHpj JE/09dEVOj9gGtf7+J2t/ZqJyOpZUjJpM5FA1195w5TIH9wL6esbljwXYQL4PRcvLB WQyMBuSrwWdviCLV4NsgrRp/f5h69xVNUikzLV18= 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 1M5QJD-1o8sJs2ocP-001Oya; Sun, 03 Jul 2022 19:01:33 +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 9/9] serial: 8250: lpc18xx: Remove redundant sanity check for RS485 flags Date: Sun, 3 Jul 2022 19:00:39 +0200 Message-Id: <20220703170039.2058202-10-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220703170039.2058202-1-LinoSanfilippo@gmx.de> References: <20220703170039.2058202-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:KjAB4TazV/OvuLGClQIL62mGEv/0G6rRtTs5pe+N09lU9C9u8xm 81tPPKgUO4gFQ/640DbtwTghVkeUew/lXZ132Zx7lpMa7HbYuUo6nPX3HNBwTFf8pgXyXUR 1nuiwWq2ftAkbP7ADU8L6aiMNKMOe6wQAf0wbvKqGxPKe1TKDE8k2BjTm+ExZ1L9ivWvJKN o6I+B9izQFtUuVJ8eR+sw== X-UI-Out-Filterresults: notjunk:1;V03:K0:t+3L/KYJQ68=:Idxt9qmFJMRusII+8L49Aa zSEABMSFoylvJHtAm0y/CS9YVujhvonXNXu1GJTkyShWG1tLqw89/VpBtdaF2c66TTiJUgOwm KI6+f5TGj7Sjd7B0mmIFPwRVrJWSrHO3vM7edcNHpTa0JM3+RmZ3sNi8pjTpNCDuCgE5XlD2h mrm9uXPMIPy8tph8lpaYpiRBVaP7a6QTnNpWFOzQYCGe/8F6UbvMQX2oRT7BDQPOVytP02UVY YOVbhq3oqeAgMAptgRoq5CzPBVEWcvg9atN6dkcRD0mbqILD/eTf1NngAiLdn3xOlCKC4CxpV b7K0AZG7oKsqqmBarzoMIxTIObjF7JGsVyFewDGrLmOHu6UvXrKKD+M5xniRFzQaIu0378Ayn l9OH3QXdyePodceFWxarQrhf9GjXbzyVfh+YUILaK66fCx3LQft7Fhs95ccWKhpSY8Lms/RjF oRaGf0tZRFvnWA0rG4FoyI/tfd2Gb1iXqJkvC5VU1XQvcLDHmSDGo2fucc75oMYg9mD+zgu0b zoUGA4hSinXPuCh9TNIZOO6FVjA2Tw1dpnedxUfdcoSFziSRa8ZSYbVHGb1h3gGHx2TvXwoRr 4punAqCmgyhw/2/ug6fo7J4XW1Rqnp/nObBb3v3Mj0XfDN73Mcu5BvDuzpcne86IAjsKaX8km j3s4M96Mn72DBI+KiGyZS7wbiTLx/3dHJO4TZwLGMVOq7DuH6kfDfoah10cmEL4rEvPiX9Jph cPuQp1f4KdPpcu3jlt2m8Mc4P1hzY7bF924o6/Q6V5kSX5os8/S5uygtT/O8NjWCrfpSHIYvA ttZh7Kuiuasvf5BU3ZwBriZXY+oPOYCSO/aNB9B/BmmFpdJYcSVZTYKxqcbM2qY/sbazuHT94 uKvBfT88apH4yV1gcuhKhapJfubzTZl0DF46zvBeH89MH7ohbCBE/8tAJDUi5lkPNEYBboYuP IkUAB7IH7MJFUvrbj7S7wI4HGgW2TNPi+IvwqXAwfbJbuyw4/fXty4WBMHthI46HvQnULV1l4 N617UjZIHNOtqa1OkMSiAlUb3GPobKsTfHmbGXaziwEo8xCgHURaTxPLbz8vaAfpZ4Jyr7OFm 7yElBeI/pR2ocJKJx826lpW4oRhiwYe0BsN/13CYajy+gHb9xgBdcVngw== 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_lpc18xx.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/tty/serial/8250/8250_lpc18xx.c b/drivers/tty/serial/8250/8250_lpc18xx.c index d7cb3bb52069..fba0bb17e536 100644 --- a/drivers/tty/serial/8250/8250_lpc18xx.c +++ b/drivers/tty/serial/8250/8250_lpc18xx.c @@ -44,12 +44,8 @@ static int lpc18xx_rs485_config(struct uart_port *port, struct ktermios *termios rs485_ctrl_reg |= LPC18XX_UART_RS485CTRL_NMMEN | LPC18XX_UART_RS485CTRL_DCTRL; - if (rs485->flags & SER_RS485_RTS_ON_SEND) { + if (rs485->flags & SER_RS485_RTS_ON_SEND) rs485_ctrl_reg |= LPC18XX_UART_RS485CTRL_OINV; - rs485->flags &= ~SER_RS485_RTS_AFTER_SEND; - } else { - rs485->flags |= SER_RS485_RTS_AFTER_SEND; - } } if (rs485->delay_rts_after_send) {