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>,
	Jingoo Han <jingoohan1@gmail.com>
Subject: [PATCH 01/10] PCI: exynos: Fix platform_get_irq() error handling
Date: Thu, 31 Aug 2017 14:52:01 -0300	[thread overview]
Message-ID: <1504201930-3617-1-git-send-email-fabio.estevam@nxp.com> (raw)

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: Jingoo Han <jingoohan1@gmail.com>
Reported-by: Bjorn Helgaas <helgaas@kernel.org>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/pci/dwc/pci-exynos.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c
index f77f872..5596fde 100644
--- a/drivers/pci/dwc/pci-exynos.c
+++ b/drivers/pci/dwc/pci-exynos.c
@@ -607,9 +607,9 @@ static int __init exynos_add_pcie_port(struct exynos_pcie *ep,
 	int ret;
 
 	pp->irq = platform_get_irq(pdev, 1);
-	if (!pp->irq) {
+	if (pp->irq < 0) {
 		dev_err(dev, "failed to get irq\n");
-		return -ENODEV;
+		return pp->irq;
 	}
 	ret = devm_request_irq(dev, pp->irq, exynos_pcie_irq_handler,
 				IRQF_SHARED, "exynos-pcie", ep);
@@ -620,9 +620,9 @@ static int __init exynos_add_pcie_port(struct exynos_pcie *ep,
 
 	if (IS_ENABLED(CONFIG_PCI_MSI)) {
 		pp->msi_irq = platform_get_irq(pdev, 0);
-		if (!pp->msi_irq) {
+		if (pp->msi_irq < 0) {
 			dev_err(dev, "failed to get msi irq\n");
-			return -ENODEV;
+			return pp->msi_irq;
 		}
 
 		ret = devm_request_irq(dev, pp->msi_irq,
-- 
2.7.4

             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 Fabio Estevam [this message]
2017-08-31 17:52 ` [PATCH 02/10] PCI: dra7xx: Fix platform_get_irq() error handling 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 ` [PATCH 08/10] PCI: altera: " Fabio Estevam
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-1-git-send-email-fabio.estevam@nxp.com \
    --to=fabio.estevam@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=jingoohan1@gmail.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).