Re: [PATCH] fix UIO with device tree but no assigned interrupt

From: Grant Likely
Date: Tue Jun 18 2013 - 05:03:35 EST


On Mon, Jun 17, 2013 at 2:49 PM, Pavel Machek <pavel@xxxxxxx> wrote:
> If device is initialized from device tree, but has no interrupt assigned,
> uio will still try to request and interrupt old way, fails, and fails registration.
>
> This is wrong; don't try initializing irq using platform data if device tree is
> available.
>
> Signed-off-by: Pavel Machek <pavel@xxxxxxx>
> Reported-by: Detlev Zundel <dzu@xxxxxxx>
> Tested-by: Detlev Zundel <dzu@xxxxxxx>
>
> diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
> index 8fcc2c7..f709ead 100644
> --- a/drivers/uio/uio_pdrv_genirq.c
> +++ b/drivers/uio/uio_pdrv_genirq.c
> @@ -213,7 +213,8 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev)
> goto bad0;
> }
>
> - if (!uioinfo->irq) {
> + /* interrupts from device tree are already handled above */
> + if (!pdev->dev.of_node && !uioinfo->irq) {
> ret = platform_get_irq(pdev, 0);
> if (ret < 0) {
> dev_err(&pdev->dev, "failed to get IRQ\n");

This looks backwards. The OF code block is actually duplicating this
block. It would be better to drop the call to platform_get_irq from
the of node processing and let it fall through to this call.

g.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/