linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Govindraj.R" <govindraj.raja@ti.com>
To: linux-omap@vger.kernel.org
Cc: linux-serial@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Kevin Hilman <khilman@ti.com>, Tony Lindgren <tony@atomide.com>,
	Partha Basak <p-basak2@ti.com>,
	Vishwanath Sripathy <vishwanath.bs@ti.com>,
	Rajendra Nayak <rnayak@ti.com>,
	Santosh Shilimkar <santosh.shilimkar@ti.com>,
	Govindraj R <govindraj.raja@ti.com>
Subject: [PATCH v8 16/20] OMAP2+: UART: remove temporary variable used to count uart instance
Date: Fri, 11 Nov 2011 15:31:49 +0530	[thread overview]
Message-ID: <1321005712-21871-2-git-send-email-govindraj.raja@ti.com> (raw)
In-Reply-To: <1321005712-21871-1-git-send-email-govindraj.raja@ti.com>

Reuse the num_uarts variable itself to count number of uarts.

Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
---
 arch/arm/mach-omap2/serial.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 5c6c48f..4d65d00 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -266,15 +266,13 @@ static void omap_serial_fill_default_pads(struct omap_board_data *bdata) {}
 
 static int __init omap_serial_early_init(void)
 {
-	int i = 0;
-
 	do {
 		char oh_name[MAX_UART_HWMOD_NAME_LEN];
 		struct omap_hwmod *oh;
 		struct omap_uart_state *uart;
 
 		snprintf(oh_name, MAX_UART_HWMOD_NAME_LEN,
-			 "uart%d", i + 1);
+			 "uart%d", num_uarts + 1);
 		oh = omap_hwmod_lookup(oh_name);
 		if (!oh)
 			break;
@@ -284,9 +282,8 @@ static int __init omap_serial_early_init(void)
 			return -ENODEV;
 
 		uart->oh = oh;
-		uart->num = i++;
+		uart->num = num_uarts++;
 		list_add_tail(&uart->node, &uart_list);
-		num_uarts++;
 
 		/*
 		 * NOTE: omap_hwmod_setup*() has not yet been called,
-- 
1.7.4.1


  reply	other threads:[~2011-11-11 10:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-11 10:01 [PATCH v8 15/20] OMAP2+: UART: Make the RX_TIMEOUT for DMA configurable for each UART Govindraj.R
2011-11-11 10:01 ` Govindraj.R [this message]
2011-11-11 10:01 ` [PATCH v8 17/20] OMAP2+: UART: Use custom activate func for console uart Govindraj.R
2011-11-18 21:24   ` Kevin Hilman
2011-11-21 13:47     ` Govindraj
2011-11-21 13:51       ` Govindraj
2011-11-11 10:01 ` [PATCH v8 18/20] OMAP2+: UART: Avoid uart idling on suspend for no_console_suspend usecase Govindraj.R
2011-11-11 10:01 ` [PATCH v8 19/20] OMAP2+: UART: Do not gate uart clocks if used for debug_prints Govindraj.R
2012-01-02  9:25   ` Bedia, Vaibhav
2012-01-02 10:30     ` Govindraj
2012-01-03 10:24       ` Bedia, Vaibhav
2012-01-03 10:31         ` Govindraj
2012-01-03 11:52           ` Bedia, Vaibhav
2012-01-03 14:12             ` Govindraj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1321005712-21871-2-git-send-email-govindraj.raja@ti.com \
    --to=govindraj.raja@ti.com \
    --cc=khilman@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=p-basak2@ti.com \
    --cc=rnayak@ti.com \
    --cc=santosh.shilimkar@ti.com \
    --cc=tony@atomide.com \
    --cc=vishwanath.bs@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).