diff options
author | Fabio Estevam <fabio.estevam@nxp.com> | 2017-08-31 14:52:03 -0300 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2017-09-05 13:30:32 -0500 |
commit | 0fe5f1cd0bf08f7640c3ce945766a1af2049893e (patch) | |
tree | 7b3cc6d43a2263d1c50587e75980b3ba9027d3ed /drivers/pci/dwc | |
parent | e2e5d7bf9ba68e2ed0c70e10892472a8dd9ed9c2 (diff) | |
download | linux-0fe5f1cd0bf08f7640c3ce945766a1af2049893e.tar.bz2 |
PCI: armada8k: Fix platform_get_irq() error handling
platform_get_irq() returns a negative number on failure, so adjust the
logic to detect such condition and propagate the real error value on
failure.
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'drivers/pci/dwc')
-rw-r--r-- | drivers/pci/dwc/pcie-armada8k.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/dwc/pcie-armada8k.c b/drivers/pci/dwc/pcie-armada8k.c index 729722366c63..8047686c3856 100644 --- a/drivers/pci/dwc/pcie-armada8k.c +++ b/drivers/pci/dwc/pcie-armada8k.c @@ -176,9 +176,9 @@ static int armada8k_add_pcie_port(struct armada8k_pcie *pcie, pp->ops = &armada8k_pcie_host_ops; pp->irq = platform_get_irq(pdev, 0); - if (!pp->irq) { + if (pp->irq < 0) { dev_err(dev, "failed to get irq for port\n"); - return -ENODEV; + return pp->irq; } ret = devm_request_irq(dev, pp->irq, armada8k_pcie_irq_handler, |