Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: spear13xx: 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: Pratyush Anand <pratyush.anand@gmail.com>

authored by

Fabio Estevam and committed by
Bjorn Helgaas
343ce0cd 16f73eb0

+2 -2
+2 -2
drivers/pci/dwc/pcie-spear13xx.c
··· 199 199 int ret; 200 200 201 201 pp->irq = platform_get_irq(pdev, 0); 202 - if (!pp->irq) { 202 + if (pp->irq < 0) { 203 203 dev_err(dev, "failed to get irq\n"); 204 - return -ENODEV; 204 + return pp->irq; 205 205 } 206 206 ret = devm_request_irq(dev, pp->irq, spear13xx_pcie_irq_handler, 207 207 IRQF_SHARED | IRQF_NO_THREAD,