Skip to content

Commit cc6628f

Browse files
andy-shevgregkh
authored andcommitted
serial: 8250_pxa: 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-13-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 664f5d0 commit cc6628f

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

drivers/tty/serial/8250/8250_pxa.c

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

10197
mmres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
10298
if (!mmres)
@@ -114,21 +110,21 @@ static int serial_pxa_probe(struct platform_device *pdev)
114110
if (ret)
115111
return ret;
116112

117-
ret = of_alias_get_id(pdev->dev.of_node, "serial");
118-
if (ret >= 0)
119-
uart.port.line = ret;
120-
121113
uart.port.type = PORT_XSCALE;
122-
uart.port.iotype = UPIO_MEM32;
123114
uart.port.mapbase = mmres->start;
124-
uart.port.regshift = 2;
125-
uart.port.irq = irq;
126-
uart.port.fifosize = 64;
127115
uart.port.flags = UPF_IOREMAP | UPF_SKIP_TEST | UPF_FIXED_TYPE;
128116
uart.port.dev = &pdev->dev;
129117
uart.port.uartclk = clk_get_rate(data->clk);
130118
uart.port.pm = serial_pxa_pm;
131119
uart.port.private_data = data;
120+
121+
ret = uart_read_port_properties(&uart.port);
122+
if (ret)
123+
return ret;
124+
125+
uart.port.iotype = UPIO_MEM32;
126+
uart.port.regshift = 2;
127+
uart.port.fifosize = 64;
132128
uart.dl_write = serial_pxa_dl_write;
133129

134130
ret = serial8250_register_8250_port(&uart);

0 commit comments

Comments
 (0)