From: Guanbing Huang Date: Tue, 16 Apr 2024 03:16:37 +0000 (+0800) Subject: serial: port: Add support of PNP IRQ to __uart_read_properties() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=18ba7f2d99f698251294fe9521da3f00d03f96aa;p=linux.git serial: port: Add support of PNP IRQ to __uart_read_properties() The function __uart_read_properties doesn't cover PNP devices, so add IRQ processing for PNP devices in the branch. Signed-off-by: Guanbing Huang Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Reviewed-by: Bing Fan Tested-by: Linheng Du Link: https://lore.kernel.org/r/7f4ca31ef1cab4c6ecad22fafd82117686b696be.1713234515.git.albanhuang@tencent.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/serial_port.c b/drivers/tty/serial/serial_port.c index 3408c8827561e..47dd8c3fd06d2 100644 --- a/drivers/tty/serial/serial_port.c +++ b/drivers/tty/serial/serial_port.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -221,7 +222,11 @@ static int __uart_read_properties(struct uart_port *port, bool use_defaults) if (dev_is_platform(dev)) ret = platform_get_irq(to_platform_device(dev), 0); - else + else if (dev_is_pnp(dev)) { + ret = pnp_irq(to_pnp_dev(dev), 0); + if (ret < 0) + ret = -ENXIO; + } else ret = fwnode_irq_get(dev_fwnode(dev), 0); if (ret == -EPROBE_DEFER) return ret;