Thread (1 message) 1 message, 1 author, 2021-12-25

Re: [PATCH v2] thermal: rcar_thermal: Use platform_get_irq_optional() to get the interrupt

From: Andy Shevchenko <hidden>
Date: 2021-12-25 15:55:47
Also in: linux-renesas-soc, lkml

On Sat, Dec 25, 2021 at 1:41 PM Andy Shevchenko
[off-list ref] wrote:
On Friday, December 24, 2021, Lad Prabhakar [off-list ref] wrote:
...
quoted
+               int irq;
+
+               irq = platform_get_irq_optional(pdev, i);
+               if (irq == -ENXIO)
+                       break;
+               if (irq < 0) {
+                       ret = irq;
+                       goto error_unregister;
+               }

In all your patches which introduce optional IRQ please change the logic to the opposite:

  if (irq > 0)
    ...we got one...
  if (irq == -EPROBE_DEFER)
    ...return it, if it is ever possible...

With this you adding me a work.
I noticed that in some patches you actually do the right things, so,
please do it in the same way where you use _optiomal() variant, i.e.

if (ret < 0 && ret != -ENXIO)
  return ret;
if (ret > 0)
  ...we got it...

-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help