[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACxGe6sO6Tes8en905cyJwP69w82PHjwKV9+XxxXhAPMRyGYkA@mail.gmail.com>
Date: Tue, 18 Jun 2013 10:03:05 +0100
From: Grant Likely <grant.likely@...retlab.ca>
To: Pavel Machek <pavel@...x.de>
Cc: Detlev Zundel <dzu@...x.de>, "Hans J. Koch" <hjk@...sjkoch.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Rob Herring <rob.herring@...xeda.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
trivial@...nel.org
Subject: Re: [PATCH] fix UIO with device tree but no assigned interrupt
On Mon, Jun 17, 2013 at 2:49 PM, Pavel Machek <pavel@...x.de> 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@...x.de>
> Reported-by: Detlev Zundel <dzu@...x.de>
> Tested-by: Detlev Zundel <dzu@...x.de>
>
> 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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists