[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230802150545.3742-3-jszhang@kernel.org>
Date: Wed, 2 Aug 2023 23:05:45 +0800
From: Jisheng Zhang <jszhang@...nel.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Jiri Slaby <jirislaby@...nel.org>
Cc: linux-serial@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] serial: 8250_dw: fall back to poll if there's no interrupt
When there's no irq(this can be due to various reasons, for example,
no irq from HW support, or we just want to use poll solution, and so
on), falling back to poll is still better than no support at all.
Signed-off-by: Jisheng Zhang <jszhang@...nel.org>
---
drivers/tty/serial/8250/8250_dw.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index 7db51781289e..39db768517eb 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -524,8 +524,12 @@ static int dw8250_probe(struct platform_device *pdev)
return dev_err_probe(dev, -EINVAL, "no registers defined\n");
irq = platform_get_irq(pdev, 0);
- if (irq < 0)
- return irq;
+ if (irq < 0) {
+ if (irq != -ENXIO)
+ return irq;
+ /* no interrupt -> fall back to polling */
+ irq = 0;
+ }
spin_lock_init(&p->lock);
p->mapbase = regs->start;
--
2.40.1
Powered by blists - more mailing lists