mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 10:29:37 +00:00
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>
This commit is contained in:
parent
bfdbbf0e3c
commit
ef75369a5b
2 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -558,9 +558,9 @@ static int altera_pcie_parse_dt(struct altera_pcie *pcie)
|
|||
|
||||
/* setup IRQ */
|
||||
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);
|
||||
return -EINVAL;
|
||||
return pcie->irq;
|
||||
}
|
||||
|
||||
irq_set_chained_handler_and_data(pcie->irq, altera_pcie_isr, pcie);
|
||||
|
|
Loading…
Reference in a new issue