[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHp75VdL_v3vZwQfCqNUwg3oQbvWpq4HCL2KGbaob88-4w9RNw@mail.gmail.com>
Date: Wed, 12 Jan 2022 13:32:37 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Cc: Hans Verkuil <hverkuil-cisco@...all.nl>,
"Lad, Prabhakar" <prabhakar.csengg@...il.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Linux Media Mailing List <linux-media@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] media: davinci: vpif: Use platform_get_irq_optional()
to get the interrupt
On Tue, Jan 11, 2022 at 9:40 PM Lad Prabhakar
<prabhakar.mahadev-lad.rj@...renesas.com> 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().
>
> While at it, propagate error code in case devm_request_irq() fails
> instead of returning -EINVAL.
...
> + while (1) {
The infinite loop use is discouraged.
> + int irq;
> +
> + err = platform_get_irq_optional(pdev, res_idx);
> + if (err < 0 && err != -ENXIO)
> + goto vpif_unregister;
> + if (err > 0)
> + irq = err;
> + else
> + break;
> +
> + err = devm_request_irq(&pdev->dev, irq, vpif_channel_isr,
> + IRQF_SHARED, VPIF_DRIVER_NAME,
> + (void *)(&vpif_obj.dev[res_idx]->channel_id));
> + if (err)
> goto vpif_unregister;
> - }
> res_idx++;
> }
Slightly better
do {
...
} while (++res_idx);
...
> + while (1) {
Ditto.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists