serial: push default_serial_console to drivers
[oweals/u-boot.git] / drivers / serial / serial_s3c24x0.c
index abdbff1cb018e8a0be468a049a45e8aef2578a8f..ff35ce595567be4f11656ec7cb1243904f551b6b 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include <common.h>
+#include <linux/compiler.h>
 #include <asm/arch/s3c24x0_cpu.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -310,4 +311,17 @@ INIT_S3C_SERIAL_STRUCTURE(1, "s3ser1", "S3UART2");
 DECLARE_S3C_SERIAL_FUNCTIONS(2);
 struct serial_device s3c24xx_serial2_device =
 INIT_S3C_SERIAL_STRUCTURE(2, "s3ser2", "S3UART3");
+
+__weak struct serial_device *default_serial_console(void)
+{
+#if defined(CONFIG_SERIAL1)
+       return &s3c24xx_serial0_device;
+#elif defined(CONFIG_SERIAL2)
+       return &s3c24xx_serial1_device;
+#elif defined(CONFIG_SERIAL3)
+       return &s3c24xx_serial2_device;
+#else
+#error "CONFIG_SERIAL? missing."
+#endif
+}
 #endif /* CONFIG_SERIAL_MULTI */