From 36f339d136f3b6e91235be619a88289a5f980450 Mon Sep 17 00:00:00 2001 From: Peter Hurley Date: Thu, 6 Nov 2014 09:06:12 -0500 Subject: [PATCH] serial: pl011: Fix build breakage with !CONFIG_DMA_ENGINE Commit 479e9b94fdce7bc4 ("serial: Refactor uart_flush_buffer() from uart_close") refactored the uart_flush_buffer() in uart_close() into those drivers that define a flush_buffer() method. However, in the amba-pl011 driver configured without CONFIG_DMA_ENGINE, flush_buffer() is a NULL method, so the direct call fails to compile. Check and call the flush_buffer() method through the ops table instead. Reported-by: Fengguang Wu Cc: Russell King Signed-off-by: Peter Hurley Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/amba-pl011.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 8469b66ff832..83c8f721cdb2 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -1689,7 +1689,8 @@ static void pl011_shutdown(struct uart_port *port) plat->exit(); } - pl011_dma_flush_buffer(port); + if (uap->port.ops->flush_buffer) + uap->port.ops->flush_buffer(port); } static void -- 2.39.2