Skip to content

Commit 266bc29

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

1 file changed

Lines changed: 9 additions & 17 deletions

File tree

drivers/tty/serial/8250/8250_tegra.c

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,25 +57,11 @@ static int tegra_uart_probe(struct platform_device *pdev)
5757
port = &port8250.port;
5858
spin_lock_init(&port->lock);
5959

60-
port->flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_FIXED_PORT |
61-
UPF_FIXED_TYPE;
62-
port->iotype = UPIO_MEM32;
63-
port->regshift = 2;
60+
port->flags = UPF_BOOT_AUTOCONF | UPF_FIXED_PORT | UPF_FIXED_TYPE;
6461
port->type = PORT_TEGRA;
65-
port->irqflags |= IRQF_SHARED;
6662
port->dev = &pdev->dev;
6763
port->handle_break = tegra_uart_handle_break;
6864

69-
ret = of_alias_get_id(pdev->dev.of_node, "serial");
70-
if (ret >= 0)
71-
port->line = ret;
72-
73-
ret = platform_get_irq(pdev, 0);
74-
if (ret < 0)
75-
return ret;
76-
77-
port->irq = ret;
78-
7965
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
8066
if (!res)
8167
return -ENODEV;
@@ -88,12 +74,18 @@ static int tegra_uart_probe(struct platform_device *pdev)
8874
port->mapbase = res->start;
8975
port->mapsize = resource_size(res);
9076

77+
ret = uart_read_port_properties(port);
78+
if (ret)
79+
return ret;
80+
81+
port->iotype = UPIO_MEM32;
82+
port->regshift = 2;
83+
9184
uart->rst = devm_reset_control_get_optional_shared(&pdev->dev, NULL);
9285
if (IS_ERR(uart->rst))
9386
return PTR_ERR(uart->rst);
9487

95-
if (device_property_read_u32(&pdev->dev, "clock-frequency",
96-
&port->uartclk)) {
88+
if (!port->uartclk) {
9789
uart->clk = devm_clk_get(&pdev->dev, NULL);
9890
if (IS_ERR(uart->clk)) {
9991
dev_err(&pdev->dev, "failed to get clock!\n");

0 commit comments

Comments
 (0)