]> git.sur5r.net Git - u-boot/commitdiff
serial: mpc8xx: Move serial registration from serial_initialize()
authorMarek Vasut <marex@denx.de>
Wed, 12 Sep 2012 11:50:56 +0000 (13:50 +0200)
committerTom Rini <trini@ti.com>
Mon, 15 Oct 2012 18:53:49 +0000 (11:53 -0700)
Move the registration of serial_smc and serial_scc ports from
default serial_initialize() into CPU specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The exports of both serial_scc_device and serial_smc_device can
not yet be removed as they are still used in default_serial_console()
calls.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
arch/powerpc/cpu/mpc8xx/serial.c
common/serial.c

index dc9b3236cbc628c2cd65e696910e935033fe0edd..00888e90622ec1cf012d564afd5a83fe0d053211 100644 (file)
@@ -681,6 +681,17 @@ __weak struct serial_device *default_serial_console(void)
 #endif
 }
 
+void mpc8xx_serial_initialize(void)
+{
+#if defined(CONFIG_8xx_CONS_SMC1) || defined(CONFIG_8xx_CONS_SMC2)
+       serial_register(&serial_smc_device);
+#endif
+#if    defined(CONFIG_8xx_CONS_SCC1) || defined(CONFIG_8xx_CONS_SCC2) || \
+       defined(CONFIG_8xx_CONS_SCC3) || defined(CONFIG_8xx_CONS_SCC4)
+       serial_register(&serial_scc_device);
+#endif
+}
+
 #ifdef CONFIG_MODEM_SUPPORT
 void disable_putc(void)
 {
index 7423920b9316ca43b693a493361edef186ba9783..5cbfb6d595408adc7b0651bf38c943e21db10870 100644 (file)
@@ -40,6 +40,8 @@ static void serial_null(void)
        void name(void)                                         \
                __attribute__((weak, alias("serial_null")));
 
+serial_initfunc(mpc8xx_serial_initialize);
+
 void serial_register(struct serial_device *dev)
 {
 #ifdef CONFIG_NEEDS_MANUAL_RELOC
@@ -57,14 +59,7 @@ void serial_register(struct serial_device *dev)
 
 void serial_initialize(void)
 {
-#if defined(CONFIG_8xx_CONS_SMC1) || defined(CONFIG_8xx_CONS_SMC2)
-       serial_register(&serial_smc_device);
-#endif
-#if    defined(CONFIG_8xx_CONS_SCC1) || defined(CONFIG_8xx_CONS_SCC2) || \
-       defined(CONFIG_8xx_CONS_SCC3) || defined(CONFIG_8xx_CONS_SCC4)
-       serial_register(&serial_scc_device);
-#endif
-
+       mpc8xx_serial_initialize();
 #if defined(CONFIG_SYS_NS16550_SERIAL)
 #if defined(CONFIG_SYS_NS16550_COM1)
        serial_register(&eserial1_device);