serial: meson: remove use of flag UPF_IOREMAP
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>
This commit is contained in:
parent
ff3b9cad7d
commit
1b1ecaa69c
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user