> > + */
> > +int of_device_init_irq(struct platform_device *dev)
> > +{
> > + struct device_node *np = dev->dev.of_node;
> > + int num_irq;
> > + int ret;
> > + struct resource *res = dev->resource;
> > +
> > + if (!np)
> > + return 0;
> > +
> > + num_irq = of_irq_count(np);
> > + if (!num_irq)
> > + return 0;
> > +
> > + res += dev->num_resources - num_irq;
>
> This looks fragile to me as it relies on how of_device_alloc happens to
> be implemented.
>
> > + ret = of_irq_to_resource_table(np, res, num_irq);
> > + if (ret != num_irq)
> > + return -EPROBE_DEFER;
I could reduce the depency on the resource allocation order
but I do want to preallocate the ressource
Best Regards,
J.
_______________________________________________
devicetree-discuss mailing list
[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss