serial: meson: remove use of flag UPF_IOREMAP
authorHeiner Kallweit <hkallweit1@gmail.com>
Wed, 19 Apr 2017 20:17:50 +0000 (22:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 May 2017 14:36:13 +0000 (16:36 +0200)
Flag UPF_IOREMAP is used by the 8250 subsystem only, it's not used
by the serial core. Therefore I don't see any benefit in using it
here.

In addition fix the order of calls in meson_uart_release_port.
Unmapping needs to be done first, reversing call order in
meson_uart_request_port.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/meson_uart.c

index 1220c9ac8d4b42866d3aeb445293e3d62eb5572c..171eb673ed8cb45a205a6eac1cad1588ba815bcf 100644 (file)
@@ -404,12 +404,9 @@ 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) {
-               devm_release_mem_region(port->dev, port->mapbase,
-                                       port->mapsize);
-               devm_iounmap(port->dev, port->membase);
-               port->membase = NULL;
-       }
+       devm_iounmap(port->dev, port->membase);
+       port->membase = NULL;
+       devm_release_mem_region(port->dev, port->mapbase, port->mapsize);
 }
 
 static int meson_uart_request_port(struct uart_port *port)
@@ -420,13 +417,10 @@ static int meson_uart_request_port(struct uart_port *port)
                return -EBUSY;
        }
 
-       if (port->flags & UPF_IOREMAP) {
-               port->membase = devm_ioremap_nocache(port->dev,
-                                                    port->mapbase,
-                                                    port->mapsize);
-               if (port->membase == NULL)
-                       return -ENOMEM;
-       }
+       port->membase = devm_ioremap_nocache(port->dev, port->mapbase,
+                                            port->mapsize);
+       if (!port->membase)
+               return -ENOMEM;
 
        return 0;
 }
@@ -623,7 +617,7 @@ static int meson_uart_probe(struct platform_device *pdev)
        port->mapbase = res_mem->start;
        port->mapsize = resource_size(res_mem);
        port->irq = res_irq->start;
-       port->flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_LOW_LATENCY;
+       port->flags = UPF_BOOT_AUTOCONF | UPF_LOW_LATENCY;
        port->dev = &pdev->dev;
        port->line = pdev->id;
        port->type = PORT_MESON;