linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/10] PCI: exynos: Fix platform_get_irq() error handling
@ 2017-08-31 17:52 Fabio Estevam
  2017-08-31 17:52 ` [PATCH 02/10] PCI: dra7xx: " Fabio Estevam
                   ` (10 more replies)
  0 siblings, 11 replies; 14+ messages in thread
From: Fabio Estevam @ 2017-08-31 17:52 UTC (permalink / raw)
  To: bhelgaas; +Cc: linux-pci, Fabio Estevam, Jingoo Han

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.

Cc: Jingoo Han <jingoohan1@gmail.com>
Reported-by: Bjorn Helgaas <helgaas@kernel.org>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/pci/dwc/pci-exynos.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c
index f77f872..5596fde 100644
--- a/drivers/pci/dwc/pci-exynos.c
+++ b/drivers/pci/dwc/pci-exynos.c
@@ -607,9 +607,9 @@ static int __init exynos_add_pcie_port(struct exynos_pcie *ep,
 	int ret;
 
 	pp->irq = platform_get_irq(pdev, 1);
-	if (!pp->irq) {
+	if (pp->irq < 0) {
 		dev_err(dev, "failed to get irq\n");
-		return -ENODEV;
+		return pp->irq;
 	}
 	ret = devm_request_irq(dev, pp->irq, exynos_pcie_irq_handler,
 				IRQF_SHARED, "exynos-pcie", ep);
@@ -620,9 +620,9 @@ static int __init exynos_add_pcie_port(struct exynos_pcie *ep,
 
 	if (IS_ENABLED(CONFIG_PCI_MSI)) {
 		pp->msi_irq = platform_get_irq(pdev, 0);
-		if (!pp->msi_irq) {
+		if (pp->msi_irq < 0) {
 			dev_err(dev, "failed to get msi irq\n");
-			return -ENODEV;
+			return pp->msi_irq;
 		}
 
 		ret = devm_request_irq(dev, pp->msi_irq,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 02/10] PCI: dra7xx: Fix platform_get_irq() error handling
  2017-08-31 17:52 [PATCH 01/10] PCI: exynos: Fix platform_get_irq() error handling Fabio Estevam
@ 2017-08-31 17:52 ` Fabio Estevam
  2017-09-01  6:43   ` Kishon Vijay Abraham I
  2017-08-31 17:52 ` [PATCH 03/10] PCI: armada8k: " Fabio Estevam
                   ` (9 subsequent siblings)
  10 siblings, 1 reply; 14+ messages in thread
From: Fabio Estevam @ 2017-08-31 17:52 UTC (permalink / raw)
  To: bhelgaas; +Cc: linux-pci, Fabio Estevam, Kishon Vijay Abraham I

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(-)

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,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 03/10] PCI: armada8k: Fix platform_get_irq() error handling
  2017-08-31 17:52 [PATCH 01/10] PCI: exynos: Fix platform_get_irq() error handling Fabio Estevam
  2017-08-31 17:52 ` [PATCH 02/10] PCI: dra7xx: " Fabio Estevam
@ 2017-08-31 17:52 ` Fabio Estevam
  2017-08-31 17:52 ` [PATCH 04/10] PCI: artpec6: " Fabio Estevam
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2017-08-31 17:52 UTC (permalink / raw)
  To: bhelgaas; +Cc: linux-pci, Fabio Estevam, Thomas Petazzoni

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.

Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/pci/dwc/pcie-armada8k.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/dwc/pcie-armada8k.c b/drivers/pci/dwc/pcie-armada8k.c
index f47e1a0..370d057 100644
--- a/drivers/pci/dwc/pcie-armada8k.c
+++ b/drivers/pci/dwc/pcie-armada8k.c
@@ -178,9 +178,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,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 04/10] PCI: artpec6: Fix platform_get_irq() error handling
  2017-08-31 17:52 [PATCH 01/10] PCI: exynos: Fix platform_get_irq() error handling Fabio Estevam
  2017-08-31 17:52 ` [PATCH 02/10] PCI: dra7xx: " Fabio Estevam
  2017-08-31 17:52 ` [PATCH 03/10] PCI: armada8k: " Fabio Estevam
@ 2017-08-31 17:52 ` Fabio Estevam
  2017-09-04 14:56   ` Niklas Cassel
  2017-08-31 17:52 ` [PATCH 05/10] PCI: spear13xx: " Fabio Estevam
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 14+ messages in thread
From: Fabio Estevam @ 2017-08-31 17:52 UTC (permalink / raw)
  To: bhelgaas; +Cc: linux-pci, Fabio Estevam, Niklas Cassel

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.

Cc: Niklas Cassel <niklas.cassel@axis.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/pci/dwc/pcie-artpec6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/dwc/pcie-artpec6.c b/drivers/pci/dwc/pcie-artpec6.c
index 5d81f1d..83d6ee0 100644
--- a/drivers/pci/dwc/pcie-artpec6.c
+++ b/drivers/pci/dwc/pcie-artpec6.c
@@ -209,9 +209,9 @@ static int artpec6_add_pcie_port(struct artpec6_pcie *artpec6_pcie,
 
 	if (IS_ENABLED(CONFIG_PCI_MSI)) {
 		pp->msi_irq = platform_get_irq_byname(pdev, "msi");
-		if (pp->msi_irq <= 0) {
+		if (pp->msi_irq < 0) {
 			dev_err(dev, "failed to get MSI irq\n");
-			return -ENODEV;
+			return pp->msi_irq;
 		}
 
 		ret = devm_request_irq(dev, pp->msi_irq,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 05/10] PCI: spear13xx: Fix platform_get_irq() error handling
  2017-08-31 17:52 [PATCH 01/10] PCI: exynos: Fix platform_get_irq() error handling Fabio Estevam
                   ` (2 preceding siblings ...)
  2017-08-31 17:52 ` [PATCH 04/10] PCI: artpec6: " Fabio Estevam
@ 2017-08-31 17:52 ` Fabio Estevam
  2017-08-31 17:52 ` [PATCH 06/10] PCI: xgene-msi: " Fabio Estevam
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2017-08-31 17:52 UTC (permalink / raw)
  To: bhelgaas; +Cc: linux-pci, Fabio Estevam, Pratyush Anand

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.

Cc: Pratyush Anand <pratyush.anand@gmail.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/pci/dwc/pcie-spear13xx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/dwc/pcie-spear13xx.c b/drivers/pci/dwc/pcie-spear13xx.c
index 52000bc..709189d 100644
--- a/drivers/pci/dwc/pcie-spear13xx.c
+++ b/drivers/pci/dwc/pcie-spear13xx.c
@@ -201,9 +201,9 @@ static int spear13xx_add_pcie_port(struct spear13xx_pcie *spear13xx_pcie,
 	int ret;
 
 	pp->irq = platform_get_irq(pdev, 0);
-	if (!pp->irq) {
+	if (pp->irq < 0) {
 		dev_err(dev, "failed to get irq\n");
-		return -ENODEV;
+		return pp->irq;
 	}
 	ret = devm_request_irq(dev, pp->irq, spear13xx_pcie_irq_handler,
 			       IRQF_SHARED | IRQF_NO_THREAD,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 06/10] PCI: xgene-msi: Fix platform_get_irq() error handling
  2017-08-31 17:52 [PATCH 01/10] PCI: exynos: Fix platform_get_irq() error handling Fabio Estevam
                   ` (3 preceding siblings ...)
  2017-08-31 17:52 ` [PATCH 05/10] PCI: spear13xx: " Fabio Estevam
@ 2017-08-31 17:52 ` Fabio Estevam
  2017-08-31 17:52 ` [PATCH 07/10] PCI: altera-msi: " Fabio Estevam
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2017-08-31 17:52 UTC (permalink / raw)
  To: bhelgaas; +Cc: linux-pci, Fabio Estevam, Duc Dang

When platform_get_irq() fails we should propagate the real error
value instead of always returning -EINVAL.

Cc: Duc Dang <dhdang@apm.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/pci/host/pci-xgene-msi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/host/pci-xgene-msi.c b/drivers/pci/host/pci-xgene-msi.c
index f1b633b..1f42a20 100644
--- a/drivers/pci/host/pci-xgene-msi.c
+++ b/drivers/pci/host/pci-xgene-msi.c
@@ -489,7 +489,7 @@ static int xgene_msi_probe(struct platform_device *pdev)
 		if (virt_msir < 0) {
 			dev_err(&pdev->dev, "Cannot translate IRQ index %d\n",
 				irq_index);
-			rc = -EINVAL;
+			rc = virt_msir;
 			goto error;
 		}
 		xgene_msi->msi_groups[irq_index].gic_irq = virt_msir;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 07/10] PCI: altera-msi: Fix platform_get_irq() error handling
  2017-08-31 17:52 [PATCH 01/10] PCI: exynos: Fix platform_get_irq() error handling Fabio Estevam
                   ` (4 preceding siblings ...)
  2017-08-31 17:52 ` [PATCH 06/10] PCI: xgene-msi: " Fabio Estevam
@ 2017-08-31 17:52 ` Fabio Estevam
  2017-08-31 17:52 ` [PATCH 08/10] PCI: altera: " Fabio Estevam
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2017-08-31 17:52 UTC (permalink / raw)
  To: bhelgaas; +Cc: linux-pci, Fabio Estevam, Ley Foon Tan

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.

Cc: Ley Foon Tan <lftan@altera.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/pci/host/pcie-altera-msi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pcie-altera-msi.c b/drivers/pci/host/pcie-altera-msi.c
index 2864030..d8141f4 100644
--- a/drivers/pci/host/pcie-altera-msi.c
+++ b/drivers/pci/host/pcie-altera-msi.c
@@ -265,9 +265,9 @@ static int altera_msi_probe(struct platform_device *pdev)
 		return ret;
 
 	msi->irq = platform_get_irq(pdev, 0);
-	if (msi->irq <= 0) {
+	if (msi->irq < 0) {
 		dev_err(&pdev->dev, "failed to map IRQ: %d\n", msi->irq);
-		ret = -ENODEV;
+		ret = msi->irq;
 		goto err;
 	}
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 08/10] PCI: altera: Fix platform_get_irq() error handling
  2017-08-31 17:52 [PATCH 01/10] PCI: exynos: Fix platform_get_irq() error handling Fabio Estevam
                   ` (5 preceding siblings ...)
  2017-08-31 17:52 ` [PATCH 07/10] PCI: altera-msi: " Fabio Estevam
@ 2017-08-31 17:52 ` Fabio Estevam
  2017-08-31 17:52 ` [PATCH 09/10] PCI: rockchip: " Fabio Estevam
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2017-08-31 17:52 UTC (permalink / raw)
  To: bhelgaas; +Cc: linux-pci, Fabio Estevam, Ley Foon Tan

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.

Cc: Ley Foon Tan <lftan@altera.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/pci/host/pcie-altera.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c
index 6fced59..b468b8ccc 100644
--- a/drivers/pci/host/pcie-altera.c
+++ b/drivers/pci/host/pcie-altera.c
@@ -558,9 +558,9 @@ static int altera_pcie_parse_dt(struct altera_pcie *pcie)
 
 	/* setup IRQ */
 	pcie->irq = platform_get_irq(pdev, 0);
-	if (pcie->irq <= 0) {
+	if (pcie->irq < 0) {
 		dev_err(dev, "failed to get IRQ: %d\n", pcie->irq);
-		return -EINVAL;
+		return pcie->irq;
 	}
 
 	irq_set_chained_handler_and_data(pcie->irq, altera_pcie_isr, pcie);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 09/10] PCI: rockchip: Fix platform_get_irq() error handling
  2017-08-31 17:52 [PATCH 01/10] PCI: exynos: Fix platform_get_irq() error handling Fabio Estevam
                   ` (6 preceding siblings ...)
  2017-08-31 17:52 ` [PATCH 08/10] PCI: altera: " Fabio Estevam
@ 2017-08-31 17:52 ` Fabio Estevam
  2017-08-31 17:52 ` [PATCH 10/10] PCI: xilinx-nwl: " Fabio Estevam
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2017-08-31 17:52 UTC (permalink / raw)
  To: bhelgaas; +Cc: linux-pci, Fabio Estevam, Shawn Lin

When platform_get_irq() fails we should propagate the real error
value instead of always returning -EINVAL

Cc: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/pci/host/pcie-rockchip.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
index 56c2423..d205381 100644
--- a/drivers/pci/host/pcie-rockchip.c
+++ b/drivers/pci/host/pcie-rockchip.c
@@ -962,7 +962,7 @@ static int rockchip_pcie_setup_irq(struct rockchip_pcie *rockchip)
 	irq = platform_get_irq_byname(pdev, "sys");
 	if (irq < 0) {
 		dev_err(dev, "missing sys IRQ resource\n");
-		return -EINVAL;
+		return irq;
 	}
 
 	err = devm_request_irq(dev, irq, rockchip_pcie_subsys_irq_handler,
@@ -975,7 +975,7 @@ static int rockchip_pcie_setup_irq(struct rockchip_pcie *rockchip)
 	irq = platform_get_irq_byname(pdev, "legacy");
 	if (irq < 0) {
 		dev_err(dev, "missing legacy IRQ resource\n");
-		return -EINVAL;
+		return irq;
 	}
 
 	irq_set_chained_handler_and_data(irq,
@@ -985,7 +985,7 @@ static int rockchip_pcie_setup_irq(struct rockchip_pcie *rockchip)
 	irq = platform_get_irq_byname(pdev, "client");
 	if (irq < 0) {
 		dev_err(dev, "missing client IRQ resource\n");
-		return -EINVAL;
+		return irq;
 	}
 
 	err = devm_request_irq(dev, irq, rockchip_pcie_client_irq_handler,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 10/10] PCI: xilinx-nwl: Fix platform_get_irq() error handling
  2017-08-31 17:52 [PATCH 01/10] PCI: exynos: Fix platform_get_irq() error handling Fabio Estevam
                   ` (7 preceding siblings ...)
  2017-08-31 17:52 ` [PATCH 09/10] PCI: rockchip: " Fabio Estevam
@ 2017-08-31 17:52 ` Fabio Estevam
  2017-09-01 13:17 ` [PATCH 01/10] PCI: exynos: " Jingoo Han
  2017-09-05 18:46 ` Bjorn Helgaas
  10 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2017-08-31 17:52 UTC (permalink / raw)
  To: bhelgaas; +Cc: linux-pci, Fabio Estevam, Michal Simek

When platform_get_irq() fails we should propagate the real error
value instead of always returning -EINVAL.

Cc: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/pci/host/pcie-xilinx-nwl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/host/pcie-xilinx-nwl.c b/drivers/pci/host/pcie-xilinx-nwl.c
index 573847f..65dea98 100644
--- a/drivers/pci/host/pcie-xilinx-nwl.c
+++ b/drivers/pci/host/pcie-xilinx-nwl.c
@@ -812,7 +812,7 @@ static int nwl_pcie_parse_dt(struct nwl_pcie *pcie,
 	pcie->irq_intx = platform_get_irq_byname(pdev, "intx");
 	if (pcie->irq_intx < 0) {
 		dev_err(dev, "failed to get intx IRQ %d\n", pcie->irq_intx);
-		return -EINVAL;
+		return pcie->irq_intx;
 	}
 
 	irq_set_chained_handler_and_data(pcie->irq_intx,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 02/10] PCI: dra7xx: Fix platform_get_irq() error handling
  2017-08-31 17:52 ` [PATCH 02/10] PCI: dra7xx: " Fabio Estevam
@ 2017-09-01  6:43   ` Kishon Vijay Abraham I
  0 siblings, 0 replies; 14+ messages in thread
From: Kishon Vijay Abraham I @ 2017-09-01  6:43 UTC (permalink / raw)
  To: Fabio Estevam, bhelgaas; +Cc: linux-pci



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,
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 01/10] PCI: exynos: Fix platform_get_irq() error handling
  2017-08-31 17:52 [PATCH 01/10] PCI: exynos: Fix platform_get_irq() error handling Fabio Estevam
                   ` (8 preceding siblings ...)
  2017-08-31 17:52 ` [PATCH 10/10] PCI: xilinx-nwl: " Fabio Estevam
@ 2017-09-01 13:17 ` Jingoo Han
  2017-09-05 18:46 ` Bjorn Helgaas
  10 siblings, 0 replies; 14+ messages in thread
From: Jingoo Han @ 2017-09-01 13:17 UTC (permalink / raw)
  To: 'Fabio Estevam', bhelgaas; +Cc: linux-pci

(CC'ed Joao Pinto)

On Thursday, August 31, 2017 1:52 PM, Fabio Estevam wrote:
> 
> 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.
> 
> Cc: Jingoo Han <jingoohan1@gmail.com>
> Reported-by: Bjorn Helgaas <helgaas@kernel.org>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>

Acked-by: Jingoo Han <jingoohan1@gmail.com>

Best regards,
Jingoo Han

> ---
>  drivers/pci/dwc/pci-exynos.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c
> index f77f872..5596fde 100644
> --- a/drivers/pci/dwc/pci-exynos.c
> +++ b/drivers/pci/dwc/pci-exynos.c
> @@ -607,9 +607,9 @@ static int __init exynos_add_pcie_port(struct
> exynos_pcie *ep,
>  	int ret;
> 
>  	pp->irq = platform_get_irq(pdev, 1);
> -	if (!pp->irq) {
> +	if (pp->irq < 0) {
>  		dev_err(dev, "failed to get irq\n");
> -		return -ENODEV;
> +		return pp->irq;
>  	}
>  	ret = devm_request_irq(dev, pp->irq, exynos_pcie_irq_handler,
>  				IRQF_SHARED, "exynos-pcie", ep);
> @@ -620,9 +620,9 @@ static int __init exynos_add_pcie_port(struct
> exynos_pcie *ep,
> 
>  	if (IS_ENABLED(CONFIG_PCI_MSI)) {
>  		pp->msi_irq = platform_get_irq(pdev, 0);
> -		if (!pp->msi_irq) {
> +		if (pp->msi_irq < 0) {
>  			dev_err(dev, "failed to get msi irq\n");
> -			return -ENODEV;
> +			return pp->msi_irq;
>  		}
> 
>  		ret = devm_request_irq(dev, pp->msi_irq,
> --
> 2.7.4

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 04/10] PCI: artpec6: Fix platform_get_irq() error handling
  2017-08-31 17:52 ` [PATCH 04/10] PCI: artpec6: " Fabio Estevam
@ 2017-09-04 14:56   ` Niklas Cassel
  0 siblings, 0 replies; 14+ messages in thread
From: Niklas Cassel @ 2017-09-04 14:56 UTC (permalink / raw)
  To: Fabio Estevam, bhelgaas; +Cc: linux-pci

Acked-by: Niklas Cassel <niklas.cassel@axis.com>

On 08/31/2017 07:52 PM, Fabio Estevam wrote:
> 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.
> 
> Cc: Niklas Cassel <niklas.cassel@axis.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> ---
>  drivers/pci/dwc/pcie-artpec6.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/dwc/pcie-artpec6.c b/drivers/pci/dwc/pcie-artpec6.c
> index 5d81f1d..83d6ee0 100644
> --- a/drivers/pci/dwc/pcie-artpec6.c
> +++ b/drivers/pci/dwc/pcie-artpec6.c
> @@ -209,9 +209,9 @@ static int artpec6_add_pcie_port(struct artpec6_pcie *artpec6_pcie,
>  
>  	if (IS_ENABLED(CONFIG_PCI_MSI)) {
>  		pp->msi_irq = platform_get_irq_byname(pdev, "msi");
> -		if (pp->msi_irq <= 0) {
> +		if (pp->msi_irq < 0) {
>  			dev_err(dev, "failed to get MSI irq\n");
> -			return -ENODEV;
> +			return pp->msi_irq;
>  		}
>  
>  		ret = devm_request_irq(dev, pp->msi_irq,
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 01/10] PCI: exynos: Fix platform_get_irq() error handling
  2017-08-31 17:52 [PATCH 01/10] PCI: exynos: Fix platform_get_irq() error handling Fabio Estevam
                   ` (9 preceding siblings ...)
  2017-09-01 13:17 ` [PATCH 01/10] PCI: exynos: " Jingoo Han
@ 2017-09-05 18:46 ` Bjorn Helgaas
  10 siblings, 0 replies; 14+ messages in thread
From: Bjorn Helgaas @ 2017-09-05 18:46 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: bhelgaas, linux-pci, Jingoo Han

On Thu, Aug 31, 2017 at 02:52:01PM -0300, Fabio Estevam wrote:
> 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.
> 
> Cc: Jingoo Han <jingoohan1@gmail.com>
> Reported-by: Bjorn Helgaas <helgaas@kernel.org>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>

Thanks, Fabio.  I applied all these on their respective branches for v4.14,
with the acks received so far.

> ---
>  drivers/pci/dwc/pci-exynos.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c
> index f77f872..5596fde 100644
> --- a/drivers/pci/dwc/pci-exynos.c
> +++ b/drivers/pci/dwc/pci-exynos.c
> @@ -607,9 +607,9 @@ static int __init exynos_add_pcie_port(struct exynos_pcie *ep,
>  	int ret;
>  
>  	pp->irq = platform_get_irq(pdev, 1);
> -	if (!pp->irq) {
> +	if (pp->irq < 0) {
>  		dev_err(dev, "failed to get irq\n");
> -		return -ENODEV;
> +		return pp->irq;
>  	}
>  	ret = devm_request_irq(dev, pp->irq, exynos_pcie_irq_handler,
>  				IRQF_SHARED, "exynos-pcie", ep);
> @@ -620,9 +620,9 @@ static int __init exynos_add_pcie_port(struct exynos_pcie *ep,
>  
>  	if (IS_ENABLED(CONFIG_PCI_MSI)) {
>  		pp->msi_irq = platform_get_irq(pdev, 0);
> -		if (!pp->msi_irq) {
> +		if (pp->msi_irq < 0) {
>  			dev_err(dev, "failed to get msi irq\n");
> -			return -ENODEV;
> +			return pp->msi_irq;
>  		}
>  
>  		ret = devm_request_irq(dev, pp->msi_irq,
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-09-05 18:46 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-31 17:52 [PATCH 01/10] PCI: exynos: Fix platform_get_irq() error handling Fabio Estevam
2017-08-31 17:52 ` [PATCH 02/10] PCI: dra7xx: " Fabio Estevam
2017-09-01  6:43   ` Kishon Vijay Abraham I
2017-08-31 17:52 ` [PATCH 03/10] PCI: armada8k: " Fabio Estevam
2017-08-31 17:52 ` [PATCH 04/10] PCI: artpec6: " Fabio Estevam
2017-09-04 14:56   ` Niklas Cassel
2017-08-31 17:52 ` [PATCH 05/10] PCI: spear13xx: " Fabio Estevam
2017-08-31 17:52 ` [PATCH 06/10] PCI: xgene-msi: " Fabio Estevam
2017-08-31 17:52 ` [PATCH 07/10] PCI: altera-msi: " Fabio Estevam
2017-08-31 17:52 ` [PATCH 08/10] PCI: altera: " Fabio Estevam
2017-08-31 17:52 ` [PATCH 09/10] PCI: rockchip: " Fabio Estevam
2017-08-31 17:52 ` [PATCH 10/10] PCI: xilinx-nwl: " Fabio Estevam
2017-09-01 13:17 ` [PATCH 01/10] PCI: exynos: " Jingoo Han
2017-09-05 18:46 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).