diff mbox

[02/10] PCI: dra7xx: Fix platform_get_irq() error handling

Message ID 1504201930-3617-2-git-send-email-fabio.estevam@nxp.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Fabio Estevam Aug. 31, 2017, 5:52 p.m. UTC
When platform_get_irq() fails we should propagate the real error
value instead of always returning -EINVAL.

Cc: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/pci/dwc/pci-dra7xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kishon Vijay Abraham I Sept. 1, 2017, 6:43 a.m. UTC | #1
On Thursday 31 August 2017 11:22 PM, Fabio Estevam wrote:
> When platform_get_irq() fails we should propagate the real error
> value instead of always returning -EINVAL.
> 
> Cc: Kishon Vijay Abraham I <kishon@ti.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>

Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
> ---
>  drivers/pci/dwc/pci-dra7xx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/dwc/pci-dra7xx.c b/drivers/pci/dwc/pci-dra7xx.c
> index e0dd98d..1e2aaed 100644
> --- a/drivers/pci/dwc/pci-dra7xx.c
> +++ b/drivers/pci/dwc/pci-dra7xx.c
> @@ -450,7 +450,7 @@ static int __init dra7xx_add_pcie_port(struct dra7xx_pcie *dra7xx,
>  	pp->irq = platform_get_irq(pdev, 1);
>  	if (pp->irq < 0) {
>  		dev_err(dev, "missing IRQ resource\n");
> -		return -EINVAL;
> +		return pp->irq;
>  	}
>  
>  	ret = devm_request_irq(dev, pp->irq, dra7xx_pcie_msi_irq_handler,
>
diff mbox

Patch

diff --git a/drivers/pci/dwc/pci-dra7xx.c b/drivers/pci/dwc/pci-dra7xx.c
index e0dd98d..1e2aaed 100644
--- a/drivers/pci/dwc/pci-dra7xx.c
+++ b/drivers/pci/dwc/pci-dra7xx.c
@@ -450,7 +450,7 @@  static int __init dra7xx_add_pcie_port(struct dra7xx_pcie *dra7xx,
 	pp->irq = platform_get_irq(pdev, 1);
 	if (pp->irq < 0) {
 		dev_err(dev, "missing IRQ resource\n");
-		return -EINVAL;
+		return pp->irq;
 	}
 
 	ret = devm_request_irq(dev, pp->irq, dra7xx_pcie_msi_irq_handler,