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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Dec 25, 2021 at 1:41 PM Andy Shevchenko
<andy.shevchenko@xxxxxxxxx> wrote:
> On Friday, December 24, 2021, Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx> wrote:

...

>> +               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



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux