ARM: SAMSUNG: serial: Modify console initialization.
authorThomas Abraham <thomas.ab@samsung.com>
Thu, 14 Jan 2010 06:05:38 +0000 (15:05 +0900)
committerBen Dooks <ben-linux@fluff.org>
Tue, 19 Jan 2010 08:50:47 +0000 (17:50 +0900)
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>
drivers/serial/samsung.c
drivers/serial/samsung.h

index 52e3df113ec01fd8342e824b869bc6f7d4ce5865..6982243736d1e3715dc14d3694b3a98ec80a1481 100644 (file)
@@ -1374,7 +1374,7 @@ s3c24xx_serial_get_options(struct uart_port *port, int *baud,
  * data.
 */
 
-static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info *info)
+static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info **info)
 {
        struct s3c24xx_uart_port *ptr = s3c24xx_serial_ports;
        struct platform_device **platdev_ptr;
@@ -1385,7 +1385,7 @@ static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info *info)
        platdev_ptr = s3c24xx_uart_devs;
 
        for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++, ptr++, platdev_ptr++) {
-               s3c24xx_serial_init_port(ptr, info, *platdev_ptr);
+               s3c24xx_serial_init_port(ptr, info[i], *platdev_ptr);
        }
 
        return 0;
@@ -1451,7 +1451,7 @@ static struct console s3c24xx_serial_console = {
 };
 
 int s3c24xx_serial_initconsole(struct platform_driver *drv,
-                              struct s3c24xx_uart_info *info)
+                              struct s3c24xx_uart_info **info)
 
 {
        struct platform_device *dev = s3c24xx_uart_devs[0];
index 1fb22343df423bc9e8a208de1df33fc1473f4731..0ac06a07d25ffd4b41010bcba9448588d1fa6e19 100644 (file)
@@ -75,19 +75,24 @@ extern int s3c24xx_serial_probe(struct platform_device *dev,
 extern int __devexit s3c24xx_serial_remove(struct platform_device *dev);
 
 extern int s3c24xx_serial_initconsole(struct platform_driver *drv,
-                                     struct s3c24xx_uart_info *uart);
+                                     struct s3c24xx_uart_info **uart);
 
 extern int s3c24xx_serial_init(struct platform_driver *drv,
                               struct s3c24xx_uart_info *info);
 
 #ifdef CONFIG_SERIAL_SAMSUNG_CONSOLE
 
-#define s3c24xx_console_init(__drv, __inf)                     \
-static int __init s3c_serial_console_init(void)                        \
-{                                                              \
-       return s3c24xx_serial_initconsole(__drv, __inf);        \
-}                                                              \
-                                                               \
+#define s3c24xx_console_init(__drv, __inf)                             \
+static int __init s3c_serial_console_init(void)                                \
+{                                                                      \
+       struct s3c24xx_uart_info *uinfo[CONFIG_SERIAL_SAMSUNG_UARTS];   \
+       int i;                                                          \
+                                                                       \
+       for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++)               \
+               uinfo[i] = __inf;                                       \
+       return s3c24xx_serial_initconsole(__drv, uinfo);                \
+}                                                                      \
+                                                                       \
 console_initcall(s3c_serial_console_init)
 
 #else