mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-06 13:16:22 +00:00
serial: 8250_lpc18xx: Switch to use uart_read_port_properties()
Since we have now a common helper to read port properties use it instead of sparse home grown solution. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240304123035.758700-10-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d6bd42f2c2
commit
0087b9e694
@ -92,11 +92,7 @@ static int lpc18xx_serial_probe(struct platform_device *pdev)
|
||||
struct lpc18xx_uart_data *data;
|
||||
struct uart_8250_port uart;
|
||||
struct resource *res;
|
||||
int irq, ret;
|
||||
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
int ret;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!res) {
|
||||
@ -139,19 +135,12 @@ static int lpc18xx_serial_probe(struct platform_device *pdev)
|
||||
goto dis_clk_reg;
|
||||
}
|
||||
|
||||
ret = of_alias_get_id(pdev->dev.of_node, "serial");
|
||||
if (ret >= 0)
|
||||
uart.port.line = ret;
|
||||
|
||||
data->dma.rx_param = data;
|
||||
data->dma.tx_param = data;
|
||||
|
||||
spin_lock_init(&uart.port.lock);
|
||||
uart.port.dev = &pdev->dev;
|
||||
uart.port.irq = irq;
|
||||
uart.port.iotype = UPIO_MEM32;
|
||||
uart.port.mapbase = res->start;
|
||||
uart.port.regshift = 2;
|
||||
uart.port.type = PORT_16550A;
|
||||
uart.port.flags = UPF_FIXED_PORT | UPF_FIXED_TYPE | UPF_SKIP_TEST;
|
||||
uart.port.uartclk = clk_get_rate(data->clk_uart);
|
||||
@ -160,6 +149,13 @@ static int lpc18xx_serial_probe(struct platform_device *pdev)
|
||||
uart.port.rs485_supported = lpc18xx_rs485_supported;
|
||||
uart.port.serial_out = lpc18xx_uart_serial_out;
|
||||
|
||||
ret = uart_read_port_properties(&uart.port);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
uart.port.iotype = UPIO_MEM32;
|
||||
uart.port.regshift = 2;
|
||||
|
||||
uart.dma = &data->dma;
|
||||
uart.dma->rxconf.src_maxburst = 1;
|
||||
uart.dma->txconf.dst_maxburst = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user