[RFC] [PATCH 3/3] IRQ: irq domain: defer of irq ressoure resolve at platform_drv_probe

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Wed May 29 21:26:51 EST 2013


> > + */
> > +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.


More information about the devicetree-discuss mailing list