From patchwork Fri Jul 26 18:52:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 11061763 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 D3CBE746 for ; Fri, 26 Jul 2019 18:54:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C20B728B35 for ; Fri, 26 Jul 2019 18:54:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A242228B3E; Fri, 26 Jul 2019 18:54:17 +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 37EE528B2D for ; Fri, 26 Jul 2019 18:54:17 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=HWP/LCo/fr8GLKkJl8jWHr0yvfUoTdWURQkf9yy6GD4=; b=MDA1F7/F5e//9k/MJx3HBuUVHL P0Sn3yEDsTnOEda4FaA5/kTCDHxDyHVR3t1g1tK0Lv28NaHLDqPlBHsZr+48fIfHAmVug3+GNx+xf cAHnWiAHdZ14uh35Cp2ehPdRv07uK1nLQmS2eg+qd6Bq6j9H0aFYuwKSHtr/5vqRs+kEinFIuV2qi bl0w3PIULqIUWVbhA/NbM0juHtZWfbW2zKn8QWV86dFfsawSX0Hm9SegfkekyzEVBzusOLjGKHoL+ Fhg+/JtVLttVmWK1Hc61Nnf2lZmjdO6m2HHGN8LfWSjpaQZTITchByLK4cd5x2/d9I0Ys1Mnsib0t r18IQtbg==; 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 1hr5M3-00015e-5r; Fri, 26 Jul 2019 18:54:11 +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 1hr5LG-0000N4-DU for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2019 18:53:23 +0000 Received: by mail-lj1-x242.google.com with SMTP id i21so52464945ljj.3 for ; Fri, 26 Jul 2019 11:53:22 -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; bh=sj8RVBs1fk0i3q8Mv8Hvbl0QmOyE222Bssz9akDFVOY=; b=sCGwZuU9pvjnkWWzIrVaU5Tt6VgiIQEXIJaeUOSYMNehQmShord01NCMJnfCC5ncrs 9CVWh72fv1sEcVNnZErHW9QUdHnUCH4b2ntzI3ZfB6SNqyAzJevcMb9OGgdkS5Rw/bfS AVWN8uIV3+u29U/zFqux27d/tRGdG7R5Wuj8qhshwZoV2Bha7AnWxUiDBSzlN/lhdk0z EtXtsAVq89cVegXtRVCXTwuHTlea8WRG2kj+eqRESGujdyeUSv6yDAf1Duyk4as31gFk 31JVUGPmqy/mjXVKjO4EpmoHCsR4tjQkdlpOA0X0xB2zihc7UwNLEQCDnNoyISaAe6eE EFeQ== 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; bh=sj8RVBs1fk0i3q8Mv8Hvbl0QmOyE222Bssz9akDFVOY=; b=b6abdXvbN8FQOb6nqGSOawKDfWlSv85gX2QA0oe/3VnfWMONQmi86VSqRpu1MlaS6q Qr4EfIbr45SbZuoqhIw8BUwSFM7iG8MM9u/U2i5q5gi4eBMbcXbpTkVirrGfoHsg4SOM fOW6Fgp/4PfXCxzf8ix4QbHghC0BsYrmnRiIQ9GeLZchKCj5cuR/ILOYnma9T5bu5Se9 3TAyjX/Wy57Ke9hFLDhqD38xiS6hRdYWYO2z68TOdggkeATU3BBv7M8HbwF3QXWoEGL9 dC5NzgL9wFzHm0etDHWIdueovMNxl9tvJs0nRFMr7W5Wq0R0/PXV9e3tl1Lhyykg5HUs PiSg== X-Gm-Message-State: APjAAAWc+yaQwXYA4FFVe1x4L1szKihk0Mv6GM24jdz5/+bY6ci16eqz dP/ahAd2Lu7TtWomLKcRBqI= X-Google-Smtp-Source: APXvYqzmB6/vZkocyFQqX9FSF/5ZmmXo9D8WgIVwA5Pw/VEahaXGRoJMOu09/LuIPHzg5UJ8hsucaw== X-Received: by 2002:a2e:8007:: with SMTP id j7mr50708763ljg.191.1564167201088; Fri, 26 Jul 2019 11:53:21 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id u15sm10254810lji.61.2019.07.26.11.53.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Jul 2019 11:53:20 -0700 (PDT) From: Sergey Organov To: linux-serial@vger.kernel.org Subject: [PATCH v7 3/3] serial: imx: get rid of imx_uart_rts_auto() Date: Fri, 26 Jul 2019 21:52:41 +0300 Message-Id: <1564167161-3972-4-git-send-email-sorganov@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1564167161-3972-1-git-send-email-sorganov@gmail.com> References: <20190614072801.3187-1-s.hauer@pengutronix.de> <1564167161-3972-1-git-send-email-sorganov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190726_115322_453802_33D0401B X-CRM114-Status: GOOD ( 12.39 ) 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 MIME-Version: 1.0 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. 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;