ARM: meson: serial: convert iounmap to devm_iounmap
authorFiro Yang <firogm@gmail.com>
Sun, 26 Apr 2015 10:46:06 +0000 (18:46 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 May 2015 20:27:02 +0000 (22:27 +0200)
The function meson_uart_release_port() inappropriately try to
iounmap() a resource managed by devm_ioremap_nocache().
The function meson_uart_release_port() maybe called by uart_ioctl()
that means meson_uart_release_port() is not called from within a
probe or remove function, for safety, I convert iounmap() to
devm_iounmap().

Signed-off-by: Firo Yang <firogm@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/meson_uart.c

index 67c03670262959ccf5b6c22a3dcbacce6594b980..0fc83c962d1009ec09419c9d65d3db7426741ec1 100644 (file)
@@ -370,7 +370,7 @@ static int meson_uart_verify_port(struct uart_port *port,
 static void meson_uart_release_port(struct uart_port *port)
 {
        if (port->flags & UPF_IOREMAP) {
-               iounmap(port->membase);
+               devm_iounmap(port->dev, port->membase);
                port->membase = NULL;
        }
 }