mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-06 05:06:29 +00:00
serial: 8250_ingenic: 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-9-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e6a46d073e
commit
d6bd42f2c2
@ -234,7 +234,7 @@ static int ingenic_uart_probe(struct platform_device *pdev)
|
||||
struct ingenic_uart_data *data;
|
||||
const struct ingenic_uart_config *cdata;
|
||||
struct resource *regs;
|
||||
int irq, err, line;
|
||||
int err;
|
||||
|
||||
cdata = of_device_get_match_data(&pdev->dev);
|
||||
if (!cdata) {
|
||||
@ -242,10 +242,6 @@ static int ingenic_uart_probe(struct platform_device *pdev)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
|
||||
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!regs) {
|
||||
dev_err(&pdev->dev, "no registers defined\n");
|
||||
@ -259,21 +255,19 @@ static int ingenic_uart_probe(struct platform_device *pdev)
|
||||
spin_lock_init(&uart.port.lock);
|
||||
uart.port.type = PORT_16550A;
|
||||
uart.port.flags = UPF_SKIP_TEST | UPF_IOREMAP | UPF_FIXED_TYPE;
|
||||
uart.port.iotype = UPIO_MEM;
|
||||
uart.port.mapbase = regs->start;
|
||||
uart.port.regshift = 2;
|
||||
uart.port.serial_out = ingenic_uart_serial_out;
|
||||
uart.port.serial_in = ingenic_uart_serial_in;
|
||||
uart.port.irq = irq;
|
||||
uart.port.dev = &pdev->dev;
|
||||
uart.port.fifosize = cdata->fifosize;
|
||||
uart.tx_loadsz = cdata->tx_loadsz;
|
||||
uart.capabilities = UART_CAP_FIFO | UART_CAP_RTOIE;
|
||||
|
||||
/* Check for a fixed line number */
|
||||
line = of_alias_get_id(pdev->dev.of_node, "serial");
|
||||
if (line >= 0)
|
||||
uart.port.line = line;
|
||||
err = uart_read_port_properties(&uart.port);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
uart.port.regshift = 2;
|
||||
uart.port.fifosize = cdata->fifosize;
|
||||
|
||||
uart.port.membase = devm_ioremap(&pdev->dev, regs->start,
|
||||
resource_size(regs));
|
||||
|
Loading…
Reference in New Issue
Block a user