linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabio Estevam <fabio.estevam@nxp.com>
To: <bhelgaas@google.com>
Cc: <linux-pci@vger.kernel.org>,
	Fabio Estevam <fabio.estevam@nxp.com>,
	Ley Foon Tan <lftan@altera.com>
Subject: [PATCH 08/10] PCI: altera: Fix platform_get_irq() error handling
Date: Thu, 31 Aug 2017 14:52:08 -0300	[thread overview]
Message-ID: <1504201930-3617-8-git-send-email-fabio.estevam@nxp.com> (raw)
In-Reply-To: <1504201930-3617-1-git-send-email-fabio.estevam@nxp.com>

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.

Cc: Ley Foon Tan <lftan@altera.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/pci/host/pcie-altera.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c
index 6fced59..b468b8ccc 100644
--- a/drivers/pci/host/pcie-altera.c
+++ b/drivers/pci/host/pcie-altera.c
@@ -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);
-- 
2.7.4

  parent reply	other threads:[~2017-08-31 17:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-31 17:52 [PATCH 01/10] PCI: exynos: Fix platform_get_irq() error handling Fabio Estevam
2017-08-31 17:52 ` [PATCH 02/10] PCI: dra7xx: " Fabio Estevam
2017-09-01  6:43   ` Kishon Vijay Abraham I
2017-08-31 17:52 ` [PATCH 03/10] PCI: armada8k: " Fabio Estevam
2017-08-31 17:52 ` [PATCH 04/10] PCI: artpec6: " Fabio Estevam
2017-09-04 14:56   ` Niklas Cassel
2017-08-31 17:52 ` [PATCH 05/10] PCI: spear13xx: " Fabio Estevam
2017-08-31 17:52 ` [PATCH 06/10] PCI: xgene-msi: " Fabio Estevam
2017-08-31 17:52 ` [PATCH 07/10] PCI: altera-msi: " Fabio Estevam
2017-08-31 17:52 ` Fabio Estevam [this message]
2017-08-31 17:52 ` [PATCH 09/10] PCI: rockchip: " Fabio Estevam
2017-08-31 17:52 ` [PATCH 10/10] PCI: xilinx-nwl: " Fabio Estevam
2017-09-01 13:17 ` [PATCH 01/10] PCI: exynos: " Jingoo Han
2017-09-05 18:46 ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1504201930-3617-8-git-send-email-fabio.estevam@nxp.com \
    --to=fabio.estevam@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=lftan@altera.com \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).