PCI: keystone: Propagate request_irq() failure
authorWei Yongjun <weiyj.lk@gmail.com>
Thu, 28 Jul 2016 16:16:18 +0000 (16:16 +0000)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 22 Aug 2016 19:28:42 +0000 (14:28 -0500)
Previously, if request_irq() failed, ks_add_pcie_port() always returned
zero (success).  Return the request_irq() failure result instead.

[bhelgaas: changelog]
Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-By: Murali Karicheri <m-karicheri2@ti.com>
drivers/pci/host/pci-keystone.c

index 8ba28834d470e8f8b42228988772ba25c691673a..82b461b5b08a14e2147700d99885e282918c303e 100644 (file)
@@ -334,8 +334,9 @@ static int __init ks_add_pcie_port(struct keystone_pcie *ks_pcie,
        if (ks_pcie->error_irq <= 0)
                dev_info(&pdev->dev, "no error IRQ defined\n");
        else {
-               if (request_irq(ks_pcie->error_irq, pcie_err_irq_handler,
-                               IRQF_SHARED, "pcie-error-irq", ks_pcie) < 0) {
+               ret = request_irq(ks_pcie->error_irq, pcie_err_irq_handler,
+                                 IRQF_SHARED, "pcie-error-irq", ks_pcie);
+               if (ret < 0) {
                        dev_err(&pdev->dev, "failed to request error IRQ %d\n",
                                ks_pcie->error_irq);
                        return ret;