[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZMrQ8IXyqGqTKR79@smile.fi.intel.com>
Date: Thu, 3 Aug 2023 00:56:00 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Jisheng Zhang <jszhang@...nel.org>
Cc: 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>,
Jiri Slaby <jirislaby@...nel.org>,
linux-serial@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] serial: 8250_dw: fall back to poll if there's no
interrupt
On Wed, Aug 02, 2023 at 11:05:45PM +0800, Jisheng Zhang wrote:
> 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.
...
> irq = platform_get_irq(pdev, 0);
You will still have an error message. Perhaps you need to replace it with
irq = platform_get_irq_optional(pdev, 0);
> - if (irq < 0)
> - return irq;
> + if (irq < 0) {
> + if (irq != -ENXIO)
> + return irq;
> + /* no interrupt -> fall back to polling */
> + irq = 0;
> + }
This can be slightly modified:
/* no interrupt -> fall back to polling */
if (irq == -ENXIO)
irq = 0;
if (irq < 0)
return irq;
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists