serial: pl011: Fix build breakage with !CONFIG_DMA_ENGINE
authorPeter Hurley <peter@hurleysoftware.com>
Thu, 6 Nov 2014 14:06:12 +0000 (09:06 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Nov 2014 17:35:54 +0000 (09:35 -0800)
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 <fengguang.wu@intel.com>
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/amba-pl011.c

index 8469b66ff832252b427aa22945e7a6f8363d8817..83c8f721cdb2ec21ebbba0983a4153285b16277e 100644 (file)
@@ -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