aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
diff options
context:
space:
mode:
authorAman Sharma <amanharitsh123@gmail.com>2020-03-12 00:49:02 +0530
committerBjorn Helgaas <bhelgaas@google.com>2020-05-12 08:14:43 -0500
commit0584bff09629666eea97c7ac428e55b00df211f5 (patch)
tree0f1ffb119ca31d5fbb5b996a976eafaa120b98c7 /drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
parentdriver core: platform: Clarify that IRQ 0 is invalid (diff)
downloadwireguard-linux-0584bff09629666eea97c7ac428e55b00df211f5.tar.xz
wireguard-linux-0584bff09629666eea97c7ac428e55b00df211f5.zip
PCI: Check for platform_get_irq() failure consistently
The platform_get_irq*() interfaces return either a negative error number or a valid IRQ. 0 is not a valid return value, so check for "< 0" to detect failure as recommended by the function documentation. On failure, return the error number from platform_get_irq*() instead of making up a new one. Link: https://lore.kernel.org/r/cover.1583952275.git.amanharitsh123@gmail.com [bhelgaas: commit log, squash into one patch] Signed-off-by: Aman Sharma <amanharitsh123@gmail.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Cc: Richard Zhu <hongxing.zhu@nxp.com> Cc: Lucas Stach <l.stach@pengutronix.de> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Karthikeyan Mitran <m.karthikeyan@mobiveil.co.in> Cc: Hou Zhiqiang <Zhiqiang.Hou@nxp.com> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Ryder Lee <ryder.lee@mediatek.com> Cc: Marc Gonzalez <marc.w.gonzalez@free.fr>
Diffstat (limited to 'drivers/pci/controller/mobiveil/pcie-mobiveil-host.c')
-rw-r--r--drivers/pci/controller/mobiveil/pcie-mobiveil-host.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
index a94be264240f..5907baa9b1f2 100644
--- a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
+++ b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
@@ -522,9 +522,9 @@ static int mobiveil_pcie_integrated_interrupt_init(struct mobiveil_pcie *pcie)
mobiveil_pcie_enable_msi(pcie);
rp->irq = platform_get_irq(pdev, 0);
- if (rp->irq <= 0) {
+ if (rp->irq < 0) {
dev_err(dev, "failed to map IRQ: %d\n", rp->irq);
- return -ENODEV;
+ return rp->irq;
}
/* initialize the IRQ domains */