Commit 266bc29d authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman
Browse files

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240304123035.758700-14-andriy.shevchenko@linux.intel.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cc6628f0
Loading
Loading
Loading
Loading
+9 −17
Original line number Diff line number Diff line
@@ -57,25 +57,11 @@ static int tegra_uart_probe(struct platform_device *pdev)
	port = &port8250.port;
	spin_lock_init(&port->lock);

	port->flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_FIXED_PORT |
		      UPF_FIXED_TYPE;
	port->iotype = UPIO_MEM32;
	port->regshift = 2;
	port->flags = UPF_BOOT_AUTOCONF | UPF_FIXED_PORT | UPF_FIXED_TYPE;
	port->type = PORT_TEGRA;
	port->irqflags |= IRQF_SHARED;
	port->dev = &pdev->dev;
	port->handle_break = tegra_uart_handle_break;

	ret = of_alias_get_id(pdev->dev.of_node, "serial");
	if (ret >= 0)
		port->line = ret;

	ret = platform_get_irq(pdev, 0);
	if (ret < 0)
		return ret;

	port->irq = ret;

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (!res)
		return -ENODEV;
@@ -88,12 +74,18 @@ static int tegra_uart_probe(struct platform_device *pdev)
	port->mapbase = res->start;
	port->mapsize = resource_size(res);

	ret = uart_read_port_properties(port);
	if (ret)
		return ret;

	port->iotype = UPIO_MEM32;
	port->regshift = 2;

	uart->rst = devm_reset_control_get_optional_shared(&pdev->dev, NULL);
	if (IS_ERR(uart->rst))
		return PTR_ERR(uart->rst);

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