From patchwork Mon Jul 22 19:22:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 11053341 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E5BA2112C for ; Mon, 22 Jul 2019 19:23:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D75B92837D for ; Mon, 22 Jul 2019 19:23:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CAD7028508; Mon, 22 Jul 2019 19:23:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6A0D02837D for ; Mon, 22 Jul 2019 19:23:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MfLNGfBL4x4ynp69hT8Gaa/kvY2JCkmYS0j3EEF7d9Q=; b=A+yDOAF/nK8P5T uNmELilFY69duUUAv7KorMgaAd5FjP0WBFNPf/eSAei218up4Xx4esWcSb7efnCD97wxDHQarXGMP Rap0dNY3NrzI/8elg1XGcz1Sik9960ms2O1AZPR9PMwDS7l/AX5A9XQgFw3JK1awndtMF6yMRxKPn KALphPJmL52XYBMjYoZj4T5uro4RM6dTOk6X/EbURIvjHVpxZ2m0qU9B0rWFNZOPLdB0Fw1n9OnjD HkXrG7IE0VGqi+5F7YN+csOrvDMPKVUpyNNeW5Ku7bcjONOHlnYGqbQQamDqLUHR25QlnZpQLrfv8 1o1n97uM6Ql/u1clCEFA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hpduf-0000vt-JQ; Mon, 22 Jul 2019 19:23:57 +0000 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hpdtA-00009u-KE for linux-arm-kernel@lists.infradead.org; Mon, 22 Jul 2019 19:22:26 +0000 Received: by mail-lj1-x242.google.com with SMTP id r9so38694906ljg.5 for ; Mon, 22 Jul 2019 12:22:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dMFpXLyuKl/ARSHo20Q9Hq9vNpRSPEtnIGWgcelt85w=; b=in21JgjdGrZF9LtT8nCi8uhPjZ0unyb6VwBZ3uDKYSva7WjusxgOq7TA6502tKUufi 3I42F0w//h3VKKzlNRU8t+ewOCpb+f1Y+PONiycPofWqJP4XK+QLRsFTe2NRY6h6sTe9 /TK22wxi6RF9r1mFRezHTjbxUGxUXGyVjo5FAS3Qibu71WQ9EGl92qjrCIXoPodtfTRB l1dyzM+/iqCEYB/zGo96vv8JXxqxthAFmCApqbKSa16X9JAzOH/ZPz8mkBbarAJZ66+H bbw9bMCuQJjtuOgmTqygOrraskmfqZ7kuWuxxzb6PzjaoVnlhLbM1Mpkfy3Yfx0kuzZt rdiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dMFpXLyuKl/ARSHo20Q9Hq9vNpRSPEtnIGWgcelt85w=; b=VtRMgkkeq6lrwdLImxvpN+2dq2E2l/qe+SYdq95uOxvyrVOkydgb79Ndnxo4wcguaG f/cGkeREaww9WiNrpn1N6beJTAgYajQM2OQGMTD3Wq0h9b3j1HQ8oeIhAZScLG7h+jJz 2vNNBUPVd+2ZkTCiyyrffr9qNhtvN2BEOnNna6R/nIx2gLjAkobIfmi05TC1nsMQBqcf ie4rTkwybm/+a+t9v5DRqZ6DQrIl7q5ssQTjsTaNT6mG6PipZRnqrPqMpznSYqq1vPr9 5YBBew6RaZA2FTC55AAWAR2UEnBjaCzFFrkFfEtVuRUiBykCVWWxMFy6CSBHld+yfroO l3fA== X-Gm-Message-State: APjAAAVrsoOFAGO02c+BG0B7g+Jhh4saY3YHrhs+/MRf137ZNGvjVseL oXUC9YFlTIKR75+vAZHmRMs= X-Google-Smtp-Source: APXvYqwZG9xAwevycV1eqLHdjNT7UInKyPe6n8YOGoJQBBJFUwfNpUWf3hvH8YyXA1xFOeQeDX4TBw== X-Received: by 2002:a2e:894a:: with SMTP id b10mr32119358ljk.99.1563823343029; Mon, 22 Jul 2019 12:22:23 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id n124sm6129307lfd.46.2019.07.22.12.22.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Jul 2019 12:22:22 -0700 (PDT) From: Sergey Organov To: linux-serial@vger.kernel.org Subject: [PATCH v6 3/3] serial: imx: get rid of imx_uart_rts_auto() Date: Mon, 22 Jul 2019 22:22:11 +0300 Message-Id: <1563823331-5629-4-git-send-email-sorganov@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1563823331-5629-1-git-send-email-sorganov@gmail.com> References: <20190614072801.3187-1-s.hauer@pengutronix.de> <1563823331-5629-1-git-send-email-sorganov@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190722_122224_765311_4B6FF900 X-CRM114-Status: GOOD ( 12.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kroah-Hartman , Sascha Hauer , Sergey Organov , NXP Linux Team , Pengutronix Kernel Team , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Called in only one place, for RS232, it only obscures things, as it doesn't go well with 2 similar named functions, imx_uart_rts_inactive() and imx_uart_rts_active(), that both are RS485-specific. Acked-by: Uwe Kleine-König Reviewed-by: Sascha Hauer Tested-by: Sascha Hauer Signed-off-by: Sergey Organov --- drivers/tty/serial/imx.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 059ba35..d9a73c7 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -402,17 +402,6 @@ static void imx_uart_rts_inactive(struct imx_port *sport, u32 *ucr2) mctrl_gpio_set(sport->gpios, sport->port.mctrl); } -/* called with port.lock taken and irqs caller dependent */ -static void imx_uart_rts_auto(struct imx_port *sport, u32 *ucr2) -{ - /* - * Only let receiver control RTS output if we were not requested to have - * RTS inactive (which then should take precedence). - */ - if (*ucr2 & UCR2_CTS) - *ucr2 |= UCR2_CTSC; -} - /* called with port.lock taken and irqs off */ static void imx_uart_start_rx(struct uart_port *port) { @@ -1604,8 +1593,14 @@ imx_uart_set_termios(struct uart_port *port, struct ktermios *termios, else imx_uart_rts_inactive(sport, &ucr2); - } else if (termios->c_cflag & CRTSCTS) - imx_uart_rts_auto(sport, &ucr2); + } else if (termios->c_cflag & CRTSCTS) { + /* + * Only let receiver control RTS output if we were not requested + * to have RTS inactive (which then should take precedence). + */ + if (ucr2 & UCR2_CTS) + ucr2 |= UCR2_CTSC; + } if (termios->c_cflag & CRTSCTS) ucr2 &= ~UCR2_IRTS;