From: Benedikt Spranger Date: Mon, 14 May 2012 16:48:17 +0000 (+0200) Subject: uio_pdrv_genirq: get irq through platform resource if not set otherwise X-Git-Tag: firefly_0821_release~3680^2~2825^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=94ca629e40eb7e997be21d8065c25e4f3797b03f;p=firefly-linux-kernel-4.4.55.git uio_pdrv_genirq: get irq through platform resource if not set otherwise Platform devices are configured through platform resources. The interrupt in the driver uio_pdrv_genirq is instead configured through a side channel i.e. the platform data structure. Make it possible to use the generic configuration scheme via platform resource. Signed-off-by: Benedikt Spranger Acked-by: Magnus Damm Signed-off-by: "Hans J. Koch" Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c index b98371d93a92..42202cd83158 100644 --- a/drivers/uio/uio_pdrv_genirq.c +++ b/drivers/uio/uio_pdrv_genirq.c @@ -146,6 +146,14 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev) priv->flags = 0; /* interrupt is enabled to begin with */ priv->pdev = pdev; + if (!uioinfo->irq) { + ret = platform_get_irq(pdev, 0); + if (ret < 0) { + dev_err(&pdev->dev, "failed to get IRQ\n"); + goto bad0; + } + uioinfo->irq = ret; + } uiomem = &uioinfo->mem[0]; for (i = 0; i < pdev->num_resources; ++i) {