diff options
author | Thomas Weber <swirl@gmx.li> | 2010-02-25 04:40:19 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-03-11 17:50:00 -0500 |
commit | 21b90340207d324f92111e25ead1752533eeb9ca (patch) | |
tree | d42dc0c3481ae599529ec8914074c9b0ee6806c4 /arch/arm | |
parent | 9e542f37ce20428170010baa36a0ecbfcc0b29bb (diff) |
OMAP2: serial.c: Fix number of uarts in early_init
The omap_serial_early_init prints the following errors:
Could not get uart4_ick
Could not get uart4_fck
because all the uarts available in omap_uart[] will be initialized.
Only omap4430 and omap3630 have 4 uarts at the moment.
This patch reduces the number of uarts when cpu is not omap4430 or
omap3630.
Signed-off-by: Thomas Weber <weber@corscience.de>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/serial.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index b79bc8926cc9..da77930480e9 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) | |||
644 | } | 644 | } |
645 | void __init omap_serial_early_init(void) | 645 | void __init omap_serial_early_init(void) |
646 | { | 646 | { |
647 | int i; | 647 | int i, nr_ports; |
648 | char name[16]; | 648 | char name[16]; |
649 | 649 | ||
650 | if (!(cpu_is_omap3630() || cpu_is_omap4430())) | ||
651 | nr_ports = 3; | ||
652 | else | ||
653 | nr_ports = ARRAY_SIZE(omap_uart); | ||
654 | |||
650 | /* | 655 | /* |
651 | * Make sure the serial ports are muxed on at this point. | 656 | * Make sure the serial ports are muxed on at this point. |
652 | * You have to mux them off in device drivers later on | 657 | * You have to mux them off in device drivers later on |
653 | * if not needed. | 658 | * if not needed. |
654 | */ | 659 | */ |
655 | 660 | ||
656 | for (i = 0; i < ARRAY_SIZE(omap_uart); i++) { | 661 | for (i = 0; i < nr_ports; i++) { |
657 | struct omap_uart_state *uart = &omap_uart[i]; | 662 | struct omap_uart_state *uart = &omap_uart[i]; |
658 | struct platform_device *pdev = &uart->pdev; | 663 | struct platform_device *pdev = &uart->pdev; |
659 | struct device *dev = &pdev->dev; | 664 | struct device *dev = &pdev->dev; |
@@ -669,17 +674,17 @@ void __init omap_serial_early_init(void) | |||
669 | continue; | 674 | continue; |
670 | } | 675 | } |
671 | 676 | ||
672 | sprintf(name, "uart%d_ick", i+1); | 677 | sprintf(name, "uart%d_ick", i + 1); |
673 | uart->ick = clk_get(NULL, name); | 678 | uart->ick = clk_get(NULL, name); |
674 | if (IS_ERR(uart->ick)) { | 679 | if (IS_ERR(uart->ick)) { |
675 | printk(KERN_ERR "Could not get uart%d_ick\n", i+1); | 680 | printk(KERN_ERR "Could not get uart%d_ick\n", i + 1); |
676 | uart->ick = NULL; | 681 | uart->ick = NULL; |
677 | } | 682 | } |
678 | 683 | ||
679 | sprintf(name, "uart%d_fck", i+1); | 684 | sprintf(name, "uart%d_fck", i+1); |
680 | uart->fck = clk_get(NULL, name); | 685 | uart->fck = clk_get(NULL, name); |
681 | if (IS_ERR(uart->fck)) { | 686 | if (IS_ERR(uart->fck)) { |
682 | printk(KERN_ERR "Could not get uart%d_fck\n", i+1); | 687 | printk(KERN_ERR "Could not get uart%d_fck\n", i + 1); |
683 | uart->fck = NULL; | 688 | uart->fck = NULL; |
684 | } | 689 | } |
685 | 690 | ||