Was there anything wrong with platform_irq_count() used by existing code?>>>
>>This lacks consistency. of_irq_count() is used for counting, but
>>platform_get_irq() is used for getting. Either platform_ or of_ API
>>should be used for both and I'd lean for platform_, since it's more
>>general.
>hmmm, right, i was thinking of removing num_irq, and do something like:
>while (nr++) {
> err = platform_get_irq(dev, nr);
> if (err == -EPROBE_DEFER)
> break;
> if (err < 0)
> return err;
> ....
>}
>
>but forgot to do that..
ok, that should work too.
>Maybe we could just move IRQ requesting to the end of probe?
>>>right, forget about that. maybe we can check iommu->domain not NULL in
>>>+ if (irq < 0) {>>
>>>+ dev_err(dev, "Failed to get IRQ, %d\n", irq);
>>> return -ENXIO;
>>> }
>>>+ err = devm_request_irq(iommu->dev, irq, rk_iommu_irq,
>>>+ IRQF_SHARED, dev_name(dev),
>>>iommu);
>>>+ if (err)
>>>+ return err;
>>> }
>>
>>Looks like there is some more initialization below. Is the driver okay
>>with the IRQ being potentially fired right here? (Shared IRQ handlers
>>might be run at request_irq() time for testing.)
>>
>rk_iommu_irq()
Best regards,
Tomasz