]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/uio/uio_dmem_genirq.c
Merge tag 'microblaze-v5.5-rc1' of git://git.monstr.eu/linux-2.6-microblaze
[linux.git] / drivers / uio / uio_dmem_genirq.c
index ebcf1434e296df43c753286c496df8150921d6ff..81c88f7bbbcbb63e0765035f759913aef099745f 100644 (file)
@@ -151,8 +151,6 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev)
        int i;
 
        if (pdev->dev.of_node) {
-               int irq;
-
                /* alloc uioinfo for one device */
                uioinfo = kzalloc(sizeof(*uioinfo), GFP_KERNEL);
                if (!uioinfo) {
@@ -163,13 +161,6 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev)
                uioinfo->name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%pOFn",
                                               pdev->dev.of_node);
                uioinfo->version = "devicetree";
-
-               /* Multiple IRQs are not supported */
-               irq = platform_get_irq(pdev, 0);
-               if (irq == -ENXIO)
-                       uioinfo->irq = UIO_IRQ_NONE;
-               else
-                       uioinfo->irq = irq;
        }
 
        if (!uioinfo || !uioinfo->name || !uioinfo->version) {
@@ -199,8 +190,11 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev)
        mutex_init(&priv->alloc_lock);
 
        if (!uioinfo->irq) {
+               /* Multiple IRQs are not supported */
                ret = platform_get_irq(pdev, 0);
-               if (ret < 0)
+               if (ret == -ENXIO && pdev->dev.of_node)
+                       ret = UIO_IRQ_NONE;
+               else if (ret < 0)
                        goto bad1;
                uioinfo->irq = ret;
        }