From patchwork Thu Aug 23 10:32:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 1365881 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id CE8993FC66 for ; Thu, 23 Aug 2012 10:43:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030269Ab2HWKm7 (ORCPT ); Thu, 23 Aug 2012 06:42:59 -0400 Received: from na3sys009aog138.obsmtp.com ([74.125.149.19]:36962 "EHLO na3sys009aog138.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933812Ab2HWKh3 (ORCPT ); Thu, 23 Aug 2012 06:37:29 -0400 Received: from mail-lpp01m010-f47.google.com ([209.85.215.47]) (using TLSv1) by na3sys009aob138.postini.com ([74.125.148.12]) with SMTP ID DSNKUDYH53KFS6+joV3IOdeRO0iaamQydDr+@postini.com; Thu, 23 Aug 2012 03:37:29 PDT Received: by lagv3 with SMTP id v3so314830lag.34 for ; Thu, 23 Aug 2012 03:37:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=y6b/JHxY3048q5fVBAYE1meszY+TmZ3Uv/xy2Wl2tMk=; b=Nh2mDy2WSsbJSw2zlPuyXhLbjKv+bPpQB4Rr2GP3zAe6JxNp+wET2AYnwHzgLyolGW hMxm33e3yVYZ8J9LdIGqVyxOaf8D7/0epuOvhgMe7j7/a8s2btNbIMxDV1EcU6mbm+3x CBt9KvlzpJTbykgOepw80WpWQEelDdwf4HkOhryH3INQdBOIJeN8fFI6J8BrlFW5BOYG 0XViLby6gBXxa/MkNcOcLWGCMevsRXE2HkedNMI3nzqxH/8vo9mDzJ9+C7M90A12pTO/ k9z/4B4XV92t3PUVA3uFo915b+E/nlZEr/nYqzWR+9Cp8uRFTT4O6ik2PVvmu1i6X4rX 27QQ== Received: by 10.112.102.68 with SMTP id fm4mr707055lbb.19.1345718246410; Thu, 23 Aug 2012 03:37:26 -0700 (PDT) Received: from localhost (cs78217178.pp.htv.fi. [62.78.217.178]) by mx.google.com with ESMTPS id sn2sm7066094lab.16.2012.08.23.03.37.24 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 23 Aug 2012 03:37:25 -0700 (PDT) From: Felipe Balbi To: alan@linux.intel.com Cc: Tony Lindgren , Kevin Hilman , Linux OMAP Mailing List , Linux ARM Kernel Mailing List , linux-serial@vger.kernel.org, Linux Kernel Mailing List , Santosh Shilimkar , Shubhrajyoti Datta , Sourav Poddar , Felipe Balbi Subject: [PATCH v3 08/23] serial: omap: move THRE check to transmit_chars() Date: Thu, 23 Aug 2012 13:32:48 +0300 Message-Id: <1345717983-18179-9-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.12.rc3 In-Reply-To: <1345717983-18179-1-git-send-email-balbi@ti.com> References: <1345717983-18179-1-git-send-email-balbi@ti.com> X-Gm-Message-State: ALoCoQlCtlM6PZpIBu/qIR8+fTb/c8vsZB6EYQ6iicYr4KS6UsdGQh0GJ8cyb5l7M7y4u3RaCD08 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org since all other IRQ types now do all necessary checks inside their handlers, transmit_chars() was the only one left expecting serial_omap_irq() to check THRE for it. We can move THRE check to transmit_chars() in order to make serial_omap_irq() more uniform. Tested-by: Shubhrajyoti D Acked-by: Santosh Shilimkar Signed-off-by: Felipe Balbi --- drivers/tty/serial/omap-serial.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index e55f9f1..50ba51e 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -195,11 +195,14 @@ static void serial_omap_stop_rx(struct uart_port *port) pm_runtime_put_autosuspend(up->dev); } -static void transmit_chars(struct uart_omap_port *up) +static void transmit_chars(struct uart_omap_port *up, unsigned int lsr) { struct circ_buf *xmit = &up->port.state->xmit; int count; + if (!(lsr & UART_LSR_THRE)) + return; + if (up->port.x_char) { serial_out(up, UART_TX, up->port.x_char); up->port.icount.tx++; @@ -369,8 +372,7 @@ static inline irqreturn_t serial_omap_irq(int irq, void *dev_id) check_modem_status(up); break; case UART_IIR_THRI: - if (lsr & UART_LSR_THRE) - transmit_chars(up); + transmit_chars(up, lsr); break; case UART_IIR_RX_TIMEOUT: /* FALLTHROUGH */