Received: by 10.192.165.148 with SMTP id m20csp3563119imm; Mon, 7 May 2018 14:36:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpQ7/NcX6U98RI8chGuc74DNkSrCyBdGX7itQib+QG6YjYzZyDnlrj/2ihFEKrNakjq3j7Z X-Received: by 2002:a24:2911:: with SMTP id p17-v6mr3474585itp.37.1525729011198; Mon, 07 May 2018 14:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525729011; cv=none; d=google.com; s=arc-20160816; b=Y6TNcxUg0e0P7mAYmL+Rsc03KHMgKFDPTi/30oAMNfSf55y6JHQD8qWU89te4GhUZP Sb+JwmS84DYpBTG6QURDVBtPvOGgzzICzGMz44qbl4/b3QG55xBIK5cadtuMLejTgtGJ h/qpQPOZ+UaMaC4i89zj+CpqJBq6cIhhK1fQpNmyLKQlM/HqKbLrjtcqkqwcE/omv3DJ GVFECRzg2bQIgEJZNHe8IGxJMJjjACebsf0hMRrtZJVQSyCD1Et4j06PO0hJ4H0vX4zb u5CSxTrp5eSMC/osZCny4Nw5yHHNlps5k/y9Yu+kSVGapmnUZHdzbspIYLCnwAtXP4+U iBCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=baSWWwKNUlahYEMBkllhw29DAz8EvOFaEILwcFBTdLg=; b=D/sgX7HyXQY84apKeISDHXhkvKo3lyG1H33Xyuuw80BFcBKm88vZf41eh7oICU1kHQ VGZISDHmT0gW1ZT5NHb/rSsUguwsaIqsXDa7drx/c0ZAskGZK1dxRvRTm23IvP6LLe+v HmOi7Bl0tW7Zy6zee6cqdhKpM5BPeJcvT/Z7sMXA3basWgQYBgY1hWv9ptZYbiw3VgpH eMGHqsBTsTEEY1CguIc0EQaP/9UJffnUKHtwaDRCSlFA/FJf19/q71iAmpTRmRCN7FQz gI2Fa5Q1GWHopLbMphP4YgWk6CN+EbxZvWUuS8ZB3gts0oa2d+5t869OVbi9VyOk2ePr nETA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e184-v6si8200156itg.100.2018.05.07.14.36.37; Mon, 07 May 2018 14:36:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753356AbeEGVgZ (ORCPT + 99 others); Mon, 7 May 2018 17:36:25 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:43712 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753254AbeEGVgQ (ORCPT ); Mon, 7 May 2018 17:36:16 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 3C7E5263952 From: Sebastian Reichel To: Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org Cc: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Fabio Estevam , Shawn Guo , linux-kernel@vger.kernel.org, Sebastian Reichel Subject: [PATCH 1/2] serial: imx: cleanup imx_uart_disable_dma() Date: Mon, 7 May 2018 23:36:09 +0200 Message-Id: <20180507213610.17330-2-sebastian.reichel@collabora.co.uk> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180507213610.17330-1-sebastian.reichel@collabora.co.uk> References: <20180507213610.17330-1-sebastian.reichel@collabora.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove unrelated CTSC/CTS disabling from imx_uart_disable_dma() and move it to imx_uart_shutdown(), which is the only user of the DMA disabling function. This should not change the driver's behaviour, but improves readability. After this change imx_uart_disable_dma() does the reverse thing of imx_uart_enable_dma(). Suggested-by: Nandor Han Signed-off-by: Sebastian Reichel --- drivers/tty/serial/imx.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index c2fc6bef7a6f..3ca767b1162a 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1291,18 +1291,13 @@ static void imx_uart_enable_dma(struct imx_port *sport) static void imx_uart_disable_dma(struct imx_port *sport) { - u32 ucr1, ucr2; + u32 ucr1; /* clear UCR1 */ ucr1 = imx_uart_readl(sport, UCR1); ucr1 &= ~(UCR1_RXDMAEN | UCR1_TXDMAEN | UCR1_ATDMAEN); imx_uart_writel(sport, ucr1, UCR1); - /* clear UCR2 */ - ucr2 = imx_uart_readl(sport, UCR2); - ucr2 &= ~(UCR2_CTSC | UCR2_CTS | UCR2_ATEN); - imx_uart_writel(sport, ucr2, UCR2); - imx_uart_setup_ufcr(sport, TXTL_DEFAULT, RXTL_DEFAULT); sport->dma_is_enabled = 0; @@ -1447,7 +1442,7 @@ static void imx_uart_shutdown(struct uart_port *port) spin_lock_irqsave(&sport->port.lock, flags); ucr2 = imx_uart_readl(sport, UCR2); - ucr2 &= ~(UCR2_TXEN | UCR2_ATEN); + ucr2 &= ~(UCR2_TXEN | UCR2_CTSC | UCR2_CTS | UCR2_ATEN); imx_uart_writel(sport, ucr2, UCR2); spin_unlock_irqrestore(&sport->port.lock, flags); -- 2.17.0