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

From: Pavel Machek
Date: Mon Jun 17 2013 - 09:50:04 EST


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");

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
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/