board: nuvoton: use an event to replace last_stage_init()

Add a new event which handles this function refer to commit
("91caa3bb89b1 event: Use an event to replace last_stage_init()")

Signed-off-by: Michael Chang <zhang971090220@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
diff --git a/board/nuvoton/common/uart.c b/board/nuvoton/common/uart.c
index b35c795..06f6378 100644
--- a/board/nuvoton/common/uart.c
+++ b/board/nuvoton/common/uart.c
@@ -14,7 +14,7 @@
 #define UART_LCR	0xc
 #define LCR_DLAB	BIT(7)
 
-void board_set_console(void)
+int board_set_console(void)
 {
 	const unsigned long baudrate_table[] = CFG_SYS_BAUDRATE_TABLE;
 	struct udevice *dev = gd->cur_serial_dev;
@@ -28,12 +28,12 @@
 	int ret, i;
 
 	if (!dev)
-		return;
+		return -ENODEV;
 
 	uart_reg = dev_read_addr_ptr(dev);
 	ret = clk_get_by_index(dev, 0, &clk);
 	if (ret)
-		return;
+		return ret;
 
 	uart_clk = clk_get_rate(&clk);
 	setbits_8(uart_reg + UART_LCR, LCR_DLAB);
@@ -67,4 +67,5 @@
 	snprintf(string, sizeof(string), "ttyS0,%un8", gd->baudrate);
 	env_set("console", string);
 
+	return 0;
 }
diff --git a/board/nuvoton/common/uart.h b/board/nuvoton/common/uart.h
index 9cc8952..fc8ec47 100644
--- a/board/nuvoton/common/uart.h
+++ b/board/nuvoton/common/uart.h
@@ -6,6 +6,6 @@
 #ifndef _NUVOTON_UART_H
 #define _NUVOTON_UART_H
 
-void board_set_console(void);
+int board_set_console(void);
 
 #endif /* _NUVOTON_COMMON_H */