Skip to content

Commit 18ba7f2

Browse files
Guanbing Huanggregkh
authored andcommitted
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 <[email protected]> Suggested-by: Andy Shevchenko <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Bing Fan <[email protected]> Tested-by: Linheng Du <[email protected]> Link: https://lore.kernel.org/r/7f4ca31ef1cab4c6ecad22fafd82117686b696be.1713234515.git.albanhuang@tencent.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2a49b45 commit 18ba7f2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/tty/serial/serial_port.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/of.h>
1212
#include <linux/platform_device.h>
1313
#include <linux/pm_runtime.h>
14+
#include <linux/pnp.h>
1415
#include <linux/property.h>
1516
#include <linux/serial_core.h>
1617
#include <linux/spinlock.h>
@@ -221,7 +222,11 @@ static int __uart_read_properties(struct uart_port *port, bool use_defaults)
221222

222223
if (dev_is_platform(dev))
223224
ret = platform_get_irq(to_platform_device(dev), 0);
224-
else
225+
else if (dev_is_pnp(dev)) {
226+
ret = pnp_irq(to_pnp_dev(dev), 0);
227+
if (ret < 0)
228+
ret = -ENXIO;
229+
} else
225230
ret = fwnode_irq_get(dev_fwnode(dev), 0);
226231
if (ret == -EPROBE_DEFER)
227232
return ret;

0 commit comments

Comments
 (0)