From patchwork Mon Jul 22 09:22:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 11051863 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 919C5138D for ; Mon, 22 Jul 2019 09:23:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D2F92847B for ; Mon, 22 Jul 2019 09:23:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DAA228595; Mon, 22 Jul 2019 09:23:37 +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 114682847B for ; Mon, 22 Jul 2019 09:23:37 +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=miiA8R59lprX7/ohCvUsF+h8TkvFiPXnx7/k8W3wWXM=; b=egbgzWqH6zeOLE mpAfN7O+1ulxYTetIDWp7jgC4Lh7dYSej72Vqt1tbidboObXrtP+aD42EmB+vCOTTLAh5qIjhPCsx V0/TTt5uSATBlr/io6CKhWFymzWYNnryDAZaoJM+94AU1B2JOZ7n35qRPophcAhMKnHQ3qadsotHK ZiNJxcMR7zstFZEn3tSrq8n/Za/8svfSYlPflCCl5hr0Sc1dHShKX3VrW0bmHQ+z8PQl6Gqigb+zk n26WruhfQDmLZaNjEqAySagfi33nZmimG5hnky40IR6cZOyt8yOgJ0nEFF5816cwQNz+9n9HwtxHu JM0jRpQYSe7TMm5iBMRg==; 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 1hpUXZ-0007jB-R4; Mon, 22 Jul 2019 09:23:29 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hpUWW-0005bE-1g for linux-arm-kernel@lists.infradead.org; Mon, 22 Jul 2019 09:22:25 +0000 Received: by mail-lj1-x241.google.com with SMTP id h10so36893940ljg.0 for ; Mon, 22 Jul 2019 02:22:23 -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=AB9Uhy9tvuGFyl7GXO1etpCNViYG1ibv00O/NXtQ8qI=; b=sfVmdXLMToo060hTaOQKGSekZo/nQgI+rUVXwxbsl1zWdeT8Ou8wZ2DSd0Toat2wvE OY1ig9BZzEetVuVQGSORIFmmHnPUwFm7cQFl1YXb3YIvN3sfr25StiCPz4e0OpVN4UhN AIPqCCFbyocLbejYqn4Dmhxpd8r9m+llxm+qMTYzq++NXuTisw6SfkSNDajoA1gsKMK9 vkU9B5j3VTR04W7+JApSihLVrQc4YUwovUGv7R5RlXmhR3qsaxEVGlp7kCQu1vJ6KyR7 /dBYolSHWgX619+nxe0XGcpy6BOilJ54y/PPKBuB1LSWcJQQOPB0vmnEQbemPsAIihf4 LIdg== 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=AB9Uhy9tvuGFyl7GXO1etpCNViYG1ibv00O/NXtQ8qI=; b=WMkEj6Ap8+l0le6ZLj2Uol7THiAv/UtjFf7OT0/Vuf2cp14VpYCsNCHSiMnM2u8ViE cBKkz1B9Xttuj8szFRDkNhP886BKhlCJJ4kZiYd+F+Gni5pT1jhIcey9XMv3W45zNUOR dE5m1F8pgHOFFjTuYxOa8WO0eG3oqmwDo7m3pLiCKoP6RfnrzytVwrr+gCjwgBaieRTU wx96jkLD9+zba83AH1Zgtc+LrdU/qNlqvsaUPxrfuf/tNpYUaXWvfTcggi/0X5T6HQZa yQzmhU+slsvfiuyQ0KDFg3ASpOfC+p3bP5Z0MOct37tYlbC58I9WEahdR81A3PTZtjst AREQ== X-Gm-Message-State: APjAAAVgSt0FoGnmRVGxCYzpnq7CVjVW1xyFVjq1FojNPYjI88ZtCOkV ypNLGNK7zGWSrZYOnXqqYHg= X-Google-Smtp-Source: APXvYqxWQrMDT2vKFWjVmiipEuXJG5cCZHpd/xcTl4RwYawjhu07ztS2G7AVcrSV4iEL+yeypBPnlQ== X-Received: by 2002:a2e:9a19:: with SMTP id o25mr35933375lji.63.1563787342756; Mon, 22 Jul 2019 02:22:22 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id b68sm8425088ljb.0.2019.07.22.02.22.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Jul 2019 02:22:22 -0700 (PDT) From: Sergey Organov To: linux-serial@vger.kernel.org Subject: [PATCH v5 3/3] serial: imx: get rid of imx_uart_rts_auto() Date: Mon, 22 Jul 2019 12:22:10 +0300 Message-Id: <1563787330-1394-4-git-send-email-sorganov@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1563787330-1394-1-git-send-email-sorganov@gmail.com> References: <20190614072801.3187-1-s.hauer@pengutronix.de> <1563787330-1394-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_022224_115919_0F65F10A X-CRM114-Status: GOOD ( 12.75 ) 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. Reviewed-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;