aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap1/serial.c2
-rw-r--r--arch/arm/mach-omap2/serial.c6
-rw-r--r--arch/arm/plat-omap/include/plat/serial.h4
3 files changed, 4 insertions, 8 deletions
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index 5ebf0946c76a..6e5207c81cf4 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -120,7 +120,7 @@ void __init omap_serial_init(void)
120 serial_platform_data[2].uartclk = OMAP1510_BASE_BAUD * 16; 120 serial_platform_data[2].uartclk = OMAP1510_BASE_BAUD * 16;
121 } 121 }
122 122
123 for (i = 0; i < OMAP_MAX_NR_PORTS; i++) { 123 for (i = 0; i < ARRAY_SIZE(serial_platform_data) - 1; i++) {
124 124
125 /* Static mapping, never released */ 125 /* Static mapping, never released */
126 serial_platform_data[i].membase = 126 serial_platform_data[i].membase =
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 72df1b188135..2e17b57f5b23 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -533,7 +533,7 @@ static inline void omap_uart_idle_init(struct omap_uart_state *uart) {}
533#define DEV_CREATE_FILE(dev, attr) 533#define DEV_CREATE_FILE(dev, attr)
534#endif /* CONFIG_PM */ 534#endif /* CONFIG_PM */
535 535
536static struct omap_uart_state omap_uart[OMAP_MAX_NR_PORTS] = { 536static struct omap_uart_state omap_uart[] = {
537 { 537 {
538 .pdev = { 538 .pdev = {
539 .name = "serial8250", 539 .name = "serial8250",
@@ -583,7 +583,7 @@ void __init omap_serial_early_init(void)
583 * if not needed. 583 * if not needed.
584 */ 584 */
585 585
586 for (i = 0; i < OMAP_MAX_NR_PORTS; i++) { 586 for (i = 0; i < ARRAY_SIZE(omap_uart); i++) {
587 struct omap_uart_state *uart = &omap_uart[i]; 587 struct omap_uart_state *uart = &omap_uart[i];
588 struct platform_device *pdev = &uart->pdev; 588 struct platform_device *pdev = &uart->pdev;
589 struct device *dev = &pdev->dev; 589 struct device *dev = &pdev->dev;
@@ -635,7 +635,7 @@ void __init omap_serial_init(void)
635{ 635{
636 int i; 636 int i;
637 637
638 for (i = 0; i < OMAP_MAX_NR_PORTS; i++) { 638 for (i = 0; i < ARRAY_SIZE(omap_uart); i++) {
639 struct omap_uart_state *uart = &omap_uart[i]; 639 struct omap_uart_state *uart = &omap_uart[i];
640 struct platform_device *pdev = &uart->pdev; 640 struct platform_device *pdev = &uart->pdev;
641 struct device *dev = &pdev->dev; 641 struct device *dev = &pdev->dev;
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
index e249186d26e2..9951345a25d6 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -20,26 +20,22 @@
20#define OMAP_UART1_BASE 0xfffb0000 20#define OMAP_UART1_BASE 0xfffb0000
21#define OMAP_UART2_BASE 0xfffb0800 21#define OMAP_UART2_BASE 0xfffb0800
22#define OMAP_UART3_BASE 0xfffb9800 22#define OMAP_UART3_BASE 0xfffb9800
23#define OMAP_MAX_NR_PORTS 3
24#elif defined(CONFIG_ARCH_OMAP2) 23#elif defined(CONFIG_ARCH_OMAP2)
25/* OMAP2 serial ports */ 24/* OMAP2 serial ports */
26#define OMAP_UART1_BASE 0x4806a000 25#define OMAP_UART1_BASE 0x4806a000
27#define OMAP_UART2_BASE 0x4806c000 26#define OMAP_UART2_BASE 0x4806c000
28#define OMAP_UART3_BASE 0x4806e000 27#define OMAP_UART3_BASE 0x4806e000
29#define OMAP_MAX_NR_PORTS 3
30#elif defined(CONFIG_ARCH_OMAP3) 28#elif defined(CONFIG_ARCH_OMAP3)
31/* OMAP3 serial ports */ 29/* OMAP3 serial ports */
32#define OMAP_UART1_BASE 0x4806a000 30#define OMAP_UART1_BASE 0x4806a000
33#define OMAP_UART2_BASE 0x4806c000 31#define OMAP_UART2_BASE 0x4806c000
34#define OMAP_UART3_BASE 0x49020000 32#define OMAP_UART3_BASE 0x49020000
35#define OMAP_MAX_NR_PORTS 3
36#elif defined(CONFIG_ARCH_OMAP4) 33#elif defined(CONFIG_ARCH_OMAP4)
37/* OMAP4 serial ports */ 34/* OMAP4 serial ports */
38#define OMAP_UART1_BASE 0x4806a000 35#define OMAP_UART1_BASE 0x4806a000
39#define OMAP_UART2_BASE 0x4806c000 36#define OMAP_UART2_BASE 0x4806c000
40#define OMAP_UART3_BASE 0x48020000 37#define OMAP_UART3_BASE 0x48020000
41#define OMAP_UART4_BASE 0x4806e000 38#define OMAP_UART4_BASE 0x4806e000
42#define OMAP_MAX_NR_PORTS 4
43#endif 39#endif
44 40
45#define OMAP1510_BASE_BAUD (12000000/16) 41#define OMAP1510_BASE_BAUD (12000000/16)