From patchwork Thu Feb 25 09:40:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Weber X-Patchwork-Id: 81923 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1P9dq7B002098 for ; Thu, 25 Feb 2010 09:39:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753873Ab0BYJjc (ORCPT ); Thu, 25 Feb 2010 04:39:32 -0500 Received: from mail.gmx.net ([213.165.64.20]:56225 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753604Ab0BYJjc (ORCPT ); Thu, 25 Feb 2010 04:39:32 -0500 Received: (qmail invoked by alias); 25 Feb 2010 09:39:29 -0000 Received: from ppp-93-104-138-196.dynamic.mnet-online.de (EHLO localhost.localdomain) [93.104.138.196] by mail.gmx.net (mp041) with SMTP; 25 Feb 2010 10:39:29 +0100 X-Authenticated: #5115406 X-Provags-ID: V01U2FsdGVkX19njAtvJKZnADiepB4OdAcqNvdymgKZunF34uLKob 10olyDSfKb14Cj From: Thomas Weber To: linux-omap@vger.kernel.org Cc: Thomas Weber , Russell King , Tony Lindgren , Kevin Hilman , Santosh Shilimkar , Vikram Pandita , Syed Rafiuddin , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Thomas Weber Subject: [RESEND][PATCH/RFC] OMAP2: serial.c: Fix number of uarts in early_init Date: Thu, 25 Feb 2010 10:40:19 +0100 Message-Id: <1267090819-17796-1-git-send-email-swirl@gmx.li> X-Mailer: git-send-email 1.6.4.4 X-Y-GMX-Trusted: 0 X-FuHaFi: 0.5 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 25 Feb 2010 09:39:52 +0000 (UTC) diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index b79bc89..da77930 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -644,16 +644,21 @@ static void serial_out_override(struct uart_port *up, int offset, int value) } void __init omap_serial_early_init(void) { - int i; + int i, nr_ports; char name[16]; + if (!(cpu_is_omap3630() || cpu_is_omap4430())) + nr_ports = 3; + else + nr_ports = ARRAY_SIZE(omap_uart); + /* * Make sure the serial ports are muxed on at this point. * You have to mux them off in device drivers later on * if not needed. */ - for (i = 0; i < ARRAY_SIZE(omap_uart); i++) { + for (i = 0; i < nr_ports; i++) { struct omap_uart_state *uart = &omap_uart[i]; struct platform_device *pdev = &uart->pdev; struct device *dev = &pdev->dev; @@ -669,17 +674,17 @@ void __init omap_serial_early_init(void) continue; } - sprintf(name, "uart%d_ick", i+1); + sprintf(name, "uart%d_ick", i + 1); uart->ick = clk_get(NULL, name); if (IS_ERR(uart->ick)) { - printk(KERN_ERR "Could not get uart%d_ick\n", i+1); + printk(KERN_ERR "Could not get uart%d_ick\n", i + 1); uart->ick = NULL; } sprintf(name, "uart%d_fck", i+1); uart->fck = clk_get(NULL, name); if (IS_ERR(uart->fck)) { - printk(KERN_ERR "Could not get uart%d_fck\n", i+1); + printk(KERN_ERR "Could not get uart%d_fck\n", i + 1); uart->fck = NULL; }