From: Fabio Estevam Date: Thu, 31 Aug 2017 17:52:03 +0000 (-0300) Subject: PCI: armada8k: Fix platform_get_irq() error handling X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0fe5f1cd0bf08f7640c3ce945766a1af2049893e;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git PCI: armada8k: 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 Signed-off-by: Bjorn Helgaas Cc: Thomas Petazzoni --- diff --git a/drivers/pci/dwc/pcie-armada8k.c b/drivers/pci/dwc/pcie-armada8k.c index 729722366c63..8047686c3856 100644 --- a/drivers/pci/dwc/pcie-armada8k.c +++ b/drivers/pci/dwc/pcie-armada8k.c @@ -176,9 +176,9 @@ static int armada8k_add_pcie_port(struct armada8k_pcie *pcie, pp->ops = &armada8k_pcie_host_ops; pp->irq = platform_get_irq(pdev, 0); - if (!pp->irq) { + if (pp->irq < 0) { dev_err(dev, "failed to get irq for port\n"); - return -ENODEV; + return pp->irq; } ret = devm_request_irq(dev, pp->irq, armada8k_pcie_irq_handler,