Commit 51fe52229e3765dc56b8d2dd5df656fbf8a20500

Authored by Thomas Abraham
Committed by Ben Dooks
1 parent bb9b1c7727

ARM: SAMSUNG: serial: Modify console initialization.

This patch modifies s3c24xx_serial_initconsole function to accept multiple
platform UART information structures. This is required on platforms that have
differences among the instances of UART ports. As an example, the FIFO sizes
could be different for each UART instance and hence multiple platform UART
information structures would be needed.

This patch also modifies the s3c24xx_console_init macro since it wraps the
call to the s3c24xx_serial_initconsole function.

Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>

Showing 2 changed files with 15 additions and 10 deletions Side-by-side Diff

drivers/serial/samsung.c
... ... @@ -1374,7 +1374,7 @@
1374 1374 * data.
1375 1375 */
1376 1376  
1377   -static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info *info)
  1377 +static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info **info)
1378 1378 {
1379 1379 struct s3c24xx_uart_port *ptr = s3c24xx_serial_ports;
1380 1380 struct platform_device **platdev_ptr;
... ... @@ -1385,7 +1385,7 @@
1385 1385 platdev_ptr = s3c24xx_uart_devs;
1386 1386  
1387 1387 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++, ptr++, platdev_ptr++) {
1388   - s3c24xx_serial_init_port(ptr, info, *platdev_ptr);
  1388 + s3c24xx_serial_init_port(ptr, info[i], *platdev_ptr);
1389 1389 }
1390 1390  
1391 1391 return 0;
... ... @@ -1451,7 +1451,7 @@
1451 1451 };
1452 1452  
1453 1453 int s3c24xx_serial_initconsole(struct platform_driver *drv,
1454   - struct s3c24xx_uart_info *info)
  1454 + struct s3c24xx_uart_info **info)
1455 1455  
1456 1456 {
1457 1457 struct platform_device *dev = s3c24xx_uart_devs[0];
drivers/serial/samsung.h
... ... @@ -75,19 +75,24 @@
75 75 extern int __devexit s3c24xx_serial_remove(struct platform_device *dev);
76 76  
77 77 extern int s3c24xx_serial_initconsole(struct platform_driver *drv,
78   - struct s3c24xx_uart_info *uart);
  78 + struct s3c24xx_uart_info **uart);
79 79  
80 80 extern int s3c24xx_serial_init(struct platform_driver *drv,
81 81 struct s3c24xx_uart_info *info);
82 82  
83 83 #ifdef CONFIG_SERIAL_SAMSUNG_CONSOLE
84 84  
85   -#define s3c24xx_console_init(__drv, __inf) \
86   -static int __init s3c_serial_console_init(void) \
87   -{ \
88   - return s3c24xx_serial_initconsole(__drv, __inf); \
89   -} \
90   - \
  85 +#define s3c24xx_console_init(__drv, __inf) \
  86 +static int __init s3c_serial_console_init(void) \
  87 +{ \
  88 + struct s3c24xx_uart_info *uinfo[CONFIG_SERIAL_SAMSUNG_UARTS]; \
  89 + int i; \
  90 + \
  91 + for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++) \
  92 + uinfo[i] = __inf; \
  93 + return s3c24xx_serial_initconsole(__drv, uinfo); \
  94 +} \
  95 + \
91 96 console_initcall(s3c_serial_console_init)
92 97  
93 98 #else