lkml.org 
[lkml]   [2022]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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@bp.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

\
 
 \ /
  Last update: 2022-01-12 12:35    [W:0.040 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site