Skip to content

Commit 0087b9e

Browse files
andy-shevgregkh
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d6bd42f commit 0087b9e

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

drivers/tty/serial/8250/8250_lpc18xx.c

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,7 @@ static int lpc18xx_serial_probe(struct platform_device *pdev)
9292
struct lpc18xx_uart_data *data;
9393
struct uart_8250_port uart;
9494
struct resource *res;
95-
int irq, ret;
96-
97-
irq = platform_get_irq(pdev, 0);
98-
if (irq < 0)
99-
return irq;
95+
int ret;
10096

10197
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
10298
if (!res) {
@@ -139,19 +135,12 @@ static int lpc18xx_serial_probe(struct platform_device *pdev)
139135
goto dis_clk_reg;
140136
}
141137

142-
ret = of_alias_get_id(pdev->dev.of_node, "serial");
143-
if (ret >= 0)
144-
uart.port.line = ret;
145-
146138
data->dma.rx_param = data;
147139
data->dma.tx_param = data;
148140

149141
spin_lock_init(&uart.port.lock);
150142
uart.port.dev = &pdev->dev;
151-
uart.port.irq = irq;
152-
uart.port.iotype = UPIO_MEM32;
153143
uart.port.mapbase = res->start;
154-
uart.port.regshift = 2;
155144
uart.port.type = PORT_16550A;
156145
uart.port.flags = UPF_FIXED_PORT | UPF_FIXED_TYPE | UPF_SKIP_TEST;
157146
uart.port.uartclk = clk_get_rate(data->clk_uart);
@@ -160,6 +149,13 @@ static int lpc18xx_serial_probe(struct platform_device *pdev)
160149
uart.port.rs485_supported = lpc18xx_rs485_supported;
161150
uart.port.serial_out = lpc18xx_uart_serial_out;
162151

152+
ret = uart_read_port_properties(&uart.port);
153+
if (ret)
154+
return ret;
155+
156+
uart.port.iotype = UPIO_MEM32;
157+
uart.port.regshift = 2;
158+
163159
uart.dma = &data->dma;
164160
uart.dma->rxconf.src_maxburst = 1;
165161
uart.dma->txconf.dst_maxburst = 1;

0 commit comments

Comments
 (0)