summaryrefslogtreecommitdiff
path: root/drivers/pci/host/pcie-altera-msi.c
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@nxp.com>2017-08-31 20:52:07 +0300
committerBjorn Helgaas <bhelgaas@google.com>2017-09-05 21:36:28 +0300
commitef75369a5b9afc8b45456218790f0f12906b7065 (patch)
treeec3c0a57e7a119e8d46cb266814639d2d662b077 /drivers/pci/host/pcie-altera-msi.c
parentbfdbbf0e3c2a6e3fe752e0dc858c982aa1ccecad (diff)
downloadlinux-ef75369a5b9afc8b45456218790f0f12906b7065.tar.xz
PCI: altera: 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: Ley Foon Tan <lftan@altera.com>
Diffstat (limited to 'drivers/pci/host/pcie-altera-msi.c')
-rw-r--r--drivers/pci/host/pcie-altera-msi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/host/pcie-altera-msi.c b/drivers/pci/host/pcie-altera-msi.c
index 2864030789f0..d8141f4865de 100644
--- a/drivers/pci/host/pcie-altera-msi.c
+++ b/drivers/pci/host/pcie-altera-msi.c
@@ -265,9 +265,9 @@ static int altera_msi_probe(struct platform_device *pdev)
return ret;
msi->irq = platform_get_irq(pdev, 0);
- if (msi->irq <= 0) {
+ if (msi->irq < 0) {
dev_err(&pdev->dev, "failed to map IRQ: %d\n", msi->irq);
- ret = -ENODEV;
+ ret = msi->irq;
goto err;
}