summaryrefslogtreecommitdiff
path: root/drivers/pci/controller/pci-v3-semi.c
diff options
context:
space:
mode:
authorAman Sharma <amanharitsh123@gmail.com>2020-03-11 22:19:02 +0300
committerBjorn Helgaas <bhelgaas@google.com>2020-05-12 16:14:43 +0300
commit0584bff09629666eea97c7ac428e55b00df211f5 (patch)
tree0f1ffb119ca31d5fbb5b996a976eafaa120b98c7 /drivers/pci/controller/pci-v3-semi.c
parenta85a6c86c25be2d2a5f9c31491f612ce0edc7869 (diff)
downloadlinux-0584bff09629666eea97c7ac428e55b00df211f5.tar.xz
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/pci-v3-semi.c')
-rw-r--r--drivers/pci/controller/pci-v3-semi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/controller/pci-v3-semi.c b/drivers/pci/controller/pci-v3-semi.c
index bd05221f5a22..a5bf945d2eda 100644
--- a/drivers/pci/controller/pci-v3-semi.c
+++ b/drivers/pci/controller/pci-v3-semi.c
@@ -777,9 +777,9 @@ static int v3_pci_probe(struct platform_device *pdev)
/* Get and request error IRQ resource */
irq = platform_get_irq(pdev, 0);
- if (irq <= 0) {
+ if (irq < 0) {
dev_err(dev, "unable to obtain PCIv3 error IRQ\n");
- return -ENODEV;
+ return irq;
}
ret = devm_request_irq(dev, irq, v3_irq, 0,
"PCIv3 error", v3);