提交 ef75369a 编写于 作者: F Fabio Estevam 提交者: Bjorn Helgaas

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: NFabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
Cc: Ley Foon Tan <lftan@altera.com>
上级 bfdbbf0e
...@@ -265,9 +265,9 @@ static int altera_msi_probe(struct platform_device *pdev) ...@@ -265,9 +265,9 @@ static int altera_msi_probe(struct platform_device *pdev)
return ret; return ret;
msi->irq = platform_get_irq(pdev, 0); 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); dev_err(&pdev->dev, "failed to map IRQ: %d\n", msi->irq);
ret = -ENODEV; ret = msi->irq;
goto err; goto err;
} }
......
...@@ -558,9 +558,9 @@ static int altera_pcie_parse_dt(struct altera_pcie *pcie) ...@@ -558,9 +558,9 @@ static int altera_pcie_parse_dt(struct altera_pcie *pcie)
/* setup IRQ */ /* setup IRQ */
pcie->irq = platform_get_irq(pdev, 0); pcie->irq = platform_get_irq(pdev, 0);
if (pcie->irq <= 0) { if (pcie->irq < 0) {
dev_err(dev, "failed to get IRQ: %d\n", pcie->irq); dev_err(dev, "failed to get IRQ: %d\n", pcie->irq);
return -EINVAL; return pcie->irq;
} }
irq_set_chained_handler_and_data(pcie->irq, altera_pcie_isr, pcie); irq_set_chained_handler_and_data(pcie->irq, altera_pcie_isr, pcie);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册