mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
serial: 8250_dw: fall back to poll if there's no interrupt
[ Upstream commit 22130dae05 ]
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@kernel.org>
Link: https://lore.kernel.org/r/20230806092056.2467-3-jszhang@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 87d80bfbd577 ("serial: 8250_dw: Don't use struct dw8250_data outside of 8250_dw")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9a733d69a4
commit
29d35f0b53
@@ -523,7 +523,10 @@ static int dw8250_probe(struct platform_device *pdev)
|
||||
if (!regs)
|
||||
return dev_err_probe(dev, -EINVAL, "no registers defined\n");
|
||||
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
irq = platform_get_irq_optional(pdev, 0);
|
||||
/* no interrupt -> fall back to polling */
|
||||
if (irq == -ENXIO)
|
||||
irq = 0;
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user