[Skiboot] [PATCH v2 13/14] console: remove con_ops->flush()

Oliver O'Halloran oohall at gmail.com
Tue Dec 20 17:03:44 AEDT 2016


Flushing the OPAL console is now handled by a driver specific OPAL call
handler so this can be removed.

Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
 core/console.c    | 20 ++++++--------------
 hw/lpc-uart.c     |  3 ---
 include/console.h |  1 -
 3 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/core/console.c b/core/console.c
index f67524726486..34605c4ed0b7 100644
--- a/core/console.c
+++ b/core/console.c
@@ -283,28 +283,20 @@ ssize_t read(int fd __unused, void *buf, size_t req_count)
 	return count;
 }
 
-static int64_t opal_console_flush(int64_t term_number)
-{
-	if (term_number != 0)
-		return OPAL_PARAMETER;
-
-	if (con_driver == NULL || con_driver->flush == NULL)
-		return OPAL_UNSUPPORTED;
-
-	return con_driver->flush();
-}
-opal_call(OPAL_CONSOLE_FLUSH, opal_console_flush, 1);
-
 /* Helper function to perform a full synchronous flush */
 void console_complete_flush(void)
 {
-	int64_t ret = opal_console_flush(0);
+	/*
+	 * Using term 0 here is a dumb hack that works because the UART
+	 * only has term 0 and the FSP doesn't have an explicit flush method.
+	 */
+	int64_t ret = opal_con_driver->flush(0);
 
 	if (ret == OPAL_UNSUPPORTED || ret == OPAL_PARAMETER)
 		return;
 
 	while (ret != OPAL_SUCCESS) {
-		ret = opal_console_flush(0);
+		ret = opal_con_driver->flush(0);
 	}
 }
 
diff --git a/hw/lpc-uart.c b/hw/lpc-uart.c
index 0800a7d8371d..336de7543e43 100644
--- a/hw/lpc-uart.c
+++ b/hw/lpc-uart.c
@@ -170,11 +170,8 @@ static size_t uart_con_write(const char *buf, size_t len)
 	return written;
 }
 
-static int64_t uart_con_flush(void);
-
 static struct con_ops uart_con_driver = {
 	.write = uart_con_write,
-	.flush = uart_con_flush
 };
 
 /*
diff --git a/include/console.h b/include/console.h
index c2e31ce4b665..53feccb00a95 100644
--- a/include/console.h
+++ b/include/console.h
@@ -51,7 +51,6 @@ struct con_ops {
 	size_t (*write)(const char *buf, size_t len);
 	size_t (*read)(char *buf, size_t len);
 	bool (*poll_read)(void);
-	int64_t (*flush)(void);
 };
 
 struct opal_con_ops {
-- 
2.7.4



More information about the Skiboot mailing list