serial: 8250_ni: Switch to use uart_read_port_properties()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 21 Mar 2025 18:20:12 +0000 (20:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Apr 2025 14:51:19 +0000 (16:51 +0200)
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>
Tested-by: Chaitanya Vadrevu <chaitanya.vadrevu@emerson.com>
Reviewed-by: Chaitanya Vadrevu <chaitanya.vadrevu@emerson.com>
Link: https://lore.kernel.org/r/20250321182119.454507-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_ni.c

index b10a42d2ad633dabaf89413cceaa9014d3960f91..03e838f440bec482e66f2fdcbd9b26df82a5dfb8 100644 (file)
@@ -285,7 +285,6 @@ static int ni16550_probe(struct platform_device *pdev)
        const char *portmode;
        bool rs232_property;
        int ret;
-       int irq;
 
        data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
        if (!data)
@@ -293,10 +292,6 @@ static int ni16550_probe(struct platform_device *pdev)
 
        spin_lock_init(&uart.port.lock);
 
-       irq = platform_get_irq(pdev, 0);
-       if (irq < 0)
-               return irq;
-
        ret = ni16550_get_regs(pdev, &uart.port);
        if (ret < 0)
                return ret;
@@ -307,10 +302,7 @@ static int ni16550_probe(struct platform_device *pdev)
        info = device_get_match_data(dev);
 
        uart.port.dev           = dev;
-       uart.port.irq           = irq;
-       uart.port.irqflags      = IRQF_SHARED;
-       uart.port.flags         = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF
-                                       | UPF_FIXED_PORT | UPF_FIXED_TYPE;
+       uart.port.flags         = UPF_BOOT_AUTOCONF | UPF_FIXED_PORT | UPF_FIXED_TYPE;
        uart.port.startup       = ni16550_port_startup;
        uart.port.shutdown      = ni16550_port_shutdown;
 
@@ -332,12 +324,16 @@ static int ni16550_probe(struct platform_device *pdev)
        /*
         * Declaration of the base clock frequency can come from one of:
         * - static declaration in this driver (for older ACPI IDs)
-        * - a "clock-frquency" ACPI
+        * - a "clock-frequency" ACPI
         */
        if (info->uartclk)
                uart.port.uartclk = info->uartclk;
-       if (device_property_read_u32(dev, "clock-frequency",
-                                    &uart.port.uartclk)) {
+
+       ret = uart_read_port_properties(&uart.port);
+       if (ret)
+               return ret;
+
+       if (!uart.port.uartclk) {
                data->clk = devm_clk_get_enabled(dev, NULL);
                if (!IS_ERR(data->clk))
                        uart.port.uartclk = clk_get_rate(data->clk);