Re: [PATCH v3] 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 Tue, Jan 4, 2022 at 4:52 PM Lad Prabhakar
<prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx> wrote:
>
> platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
> allocation of IRQ resources in DT core code, this causes an issue
> when using hierarchical interrupt domains using "interrupts" property
> in the node as this bypasses the hierarchical setup and messes up the
> irq chaining.
>
> In preparation for removal of static setup of IRQ resource from DT core
> code use platform_get_irq_optional().

...

>         for (i = 0; i < chip->nirqs; i++) {
> -               irq = platform_get_resource(pdev, IORESOURCE_IRQ, i);
> -               if (!irq)
> -                       continue;
> +               int irq;

> +               irq = platform_get_irq_optional(pdev, i);
> +               if (irq < 0 && irq != -ENXIO) {
> +                       ret = irq;
> +                       goto error_unregister;
> +               }
> +               if (!irq || irq == -ENXIO)
> +                       break;

Wouldn't be better to assign to ret

               ret = platform_get_irq_optional(pdev, i);
               if (ret < 0 && ret != -ENXIO)
                       goto error_unregister;
               if (ret > 0)
                       irq = ret;
               else
                       break;

?

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