Skip to content

Commit 644d776

Browse files
l1kgregkh
authored andcommitted
serial: 8250_bcm2835aux: Use generic remapping code
On probe the bcm2835aux UART driver misreports the register base address as 0x0: ttyS0 at MMIO 0x0 (irq = 53, base_baud = 50000000) is a 16550 That's because the driver remaps the registers itself. Take advantage of the generic remapping code in serial8250_request_std_resource() to get a message with the correct address and to simplify the driver. Signed-off-by: Lukas Wunner <[email protected]> Cc: Martin Sperl <[email protected]> Reviewed-by: Nicolas Saenz Julienne <[email protected]> Tested-by: Nicolas Saenz Julienne <[email protected]> Link: https://lore.kernel.org/r/7d1a9bdb05090d8e465fd15cd26d6e81538d07f9.1579175223.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8c3cde5 commit 644d776

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/tty/serial/8250/8250_bcm2835aux.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static int bcm2835aux_serial_probe(struct platform_device *pdev)
4141
up.port.iotype = UPIO_MEM;
4242
up.port.fifosize = 8;
4343
up.port.flags = UPF_SHARE_IRQ | UPF_FIXED_PORT | UPF_FIXED_TYPE |
44-
UPF_SKIP_TEST;
44+
UPF_SKIP_TEST | UPF_IOREMAP;
4545

4646
/* get the clock - this also enables the HW */
4747
data->clk = devm_clk_get(&pdev->dev, NULL);
@@ -64,10 +64,8 @@ static int bcm2835aux_serial_probe(struct platform_device *pdev)
6464
dev_err(&pdev->dev, "memory resource not found");
6565
return -EINVAL;
6666
}
67-
up.port.membase = devm_ioremap_resource(&pdev->dev, res);
68-
ret = PTR_ERR_OR_ZERO(up.port.membase);
69-
if (ret)
70-
return ret;
67+
up.port.mapbase = res->start;
68+
up.port.mapsize = resource_size(res);
7169

7270
/* Check for a fixed line number */
7371
ret = of_alias_get_id(pdev->dev.of_node, "serial");

0 commit comments

Comments
 (0)