All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6 v2] mmc: meson-gx-mmc: Fix platform_get_irq's error checking
@ 2017-11-18  9:33 ` Arvind Yadav
  0 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: ben-linux, ulf.hansson, adrian.hunter, vireshk, maxime.ripard,
	wens, linux, carlo, khilman
  Cc: linux-kernel, linux-arm-kernel, linux-mmc, linux-amlogic

The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/meson-gx-mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index e0862d3..d6a0695 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -1208,9 +1208,9 @@ static int meson_mmc_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (!irq) {
+	if (irq <= 0) {
 		dev_err(&pdev->dev, "failed to get interrupt resource.\n");
-		ret = -EINVAL;
+		ret = irq;
 		goto free_host;
 	}
 
-- 
2.7.4

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

* [PATCH 1/6 v2] mmc: meson-gx-mmc: Fix platform_get_irq's error checking
@ 2017-11-18  9:33 ` Arvind Yadav
  0 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: linux-arm-kernel

The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/meson-gx-mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index e0862d3..d6a0695 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -1208,9 +1208,9 @@ static int meson_mmc_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (!irq) {
+	if (irq <= 0) {
 		dev_err(&pdev->dev, "failed to get interrupt resource.\n");
-		ret = -EINVAL;
+		ret = irq;
 		goto free_host;
 	}
 
-- 
2.7.4

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

* [PATCH 1/6 v2] mmc: meson-gx-mmc: Fix platform_get_irq's error checking
@ 2017-11-18  9:33 ` Arvind Yadav
  0 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: linus-amlogic

The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/meson-gx-mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index e0862d3..d6a0695 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -1208,9 +1208,9 @@ static int meson_mmc_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (!irq) {
+	if (irq <= 0) {
 		dev_err(&pdev->dev, "failed to get interrupt resource.\n");
-		ret = -EINVAL;
+		ret = irq;
 		goto free_host;
 	}
 
-- 
2.7.4

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

* [PATCH 2/6 v2] mmc: s3cmci: Fix platform_get_irq's error checking
  2017-11-18  9:33 ` Arvind Yadav
  (?)
@ 2017-11-18  9:33   ` Arvind Yadav
  -1 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: ben-linux, ulf.hansson, adrian.hunter, vireshk, maxime.ripard,
	wens, linux, carlo, khilman
  Cc: linux-kernel, linux-arm-kernel, linux-mmc, linux-amlogic

The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/s3cmci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
index f7f157a..cc801bc 100644
--- a/drivers/mmc/host/s3cmci.c
+++ b/drivers/mmc/host/s3cmci.c
@@ -1658,9 +1658,9 @@ static int s3cmci_probe(struct platform_device *pdev)
 	}
 
 	host->irq = platform_get_irq(pdev, 0);
-	if (host->irq == 0) {
+	if (host->irq <= 0) {
 		dev_err(&pdev->dev, "failed to get interrupt resource.\n");
-		ret = -EINVAL;
+		ret = host->irq;
 		goto probe_iounmap;
 	}
 
-- 
2.7.4

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

* [PATCH 2/6 v2] mmc: s3cmci: Fix platform_get_irq's error checking
@ 2017-11-18  9:33   ` Arvind Yadav
  0 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: linux-arm-kernel

The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/s3cmci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
index f7f157a..cc801bc 100644
--- a/drivers/mmc/host/s3cmci.c
+++ b/drivers/mmc/host/s3cmci.c
@@ -1658,9 +1658,9 @@ static int s3cmci_probe(struct platform_device *pdev)
 	}
 
 	host->irq = platform_get_irq(pdev, 0);
-	if (host->irq == 0) {
+	if (host->irq <= 0) {
 		dev_err(&pdev->dev, "failed to get interrupt resource.\n");
-		ret = -EINVAL;
+		ret = host->irq;
 		goto probe_iounmap;
 	}
 
-- 
2.7.4

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

* [PATCH 2/6 v2] mmc: s3cmci: Fix platform_get_irq's error checking
@ 2017-11-18  9:33   ` Arvind Yadav
  0 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: linus-amlogic

The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/s3cmci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
index f7f157a..cc801bc 100644
--- a/drivers/mmc/host/s3cmci.c
+++ b/drivers/mmc/host/s3cmci.c
@@ -1658,9 +1658,9 @@ static int s3cmci_probe(struct platform_device *pdev)
 	}
 
 	host->irq = platform_get_irq(pdev, 0);
-	if (host->irq == 0) {
+	if (host->irq <= 0) {
 		dev_err(&pdev->dev, "failed to get interrupt resource.\n");
-		ret = -EINVAL;
+		ret = host->irq;
 		goto probe_iounmap;
 	}
 
-- 
2.7.4

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

* [PATCH 3/6 v2] mmc: sdhci-acpi: Handle return value of platform_get_irq
  2017-11-18  9:33 ` Arvind Yadav
  (?)
@ 2017-11-18  9:33   ` Arvind Yadav
  -1 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: ben-linux, ulf.hansson, adrian.hunter, vireshk, maxime.ripard,
	wens, linux, carlo, khilman
  Cc: linux-kernel, linux-arm-kernel, linux-mmc, linux-amlogic

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/sdhci-acpi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index b988997..dd8129e 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -566,6 +566,10 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
 	host->hw_name	= "ACPI";
 	host->ops	= &sdhci_acpi_ops_dflt;
 	host->irq	= platform_get_irq(pdev, 0);
+	if (host->irq <= 0) {
+		err = host->irq;
+		goto err_free;
+	}
 
 	host->ioaddr = devm_ioremap_nocache(dev, iomem->start,
 					    resource_size(iomem));
-- 
2.7.4

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

* [PATCH 3/6 v2] mmc: sdhci-acpi: Handle return value of platform_get_irq
@ 2017-11-18  9:33   ` Arvind Yadav
  0 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: linux-arm-kernel

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/sdhci-acpi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index b988997..dd8129e 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -566,6 +566,10 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
 	host->hw_name	= "ACPI";
 	host->ops	= &sdhci_acpi_ops_dflt;
 	host->irq	= platform_get_irq(pdev, 0);
+	if (host->irq <= 0) {
+		err = host->irq;
+		goto err_free;
+	}
 
 	host->ioaddr = devm_ioremap_nocache(dev, iomem->start,
 					    resource_size(iomem));
-- 
2.7.4

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

* [PATCH 3/6 v2] mmc: sdhci-acpi: Handle return value of platform_get_irq
@ 2017-11-18  9:33   ` Arvind Yadav
  0 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: linus-amlogic

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/sdhci-acpi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index b988997..dd8129e 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -566,6 +566,10 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
 	host->hw_name	= "ACPI";
 	host->ops	= &sdhci_acpi_ops_dflt;
 	host->irq	= platform_get_irq(pdev, 0);
+	if (host->irq <= 0) {
+		err = host->irq;
+		goto err_free;
+	}
 
 	host->ioaddr = devm_ioremap_nocache(dev, iomem->start,
 					    resource_size(iomem));
-- 
2.7.4

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

* [PATCH 4/6 v2] mmc: sdhci-spear: Handle return value of platform_get_irq
  2017-11-18  9:33 ` Arvind Yadav
  (?)
@ 2017-11-18  9:33   ` Arvind Yadav
  -1 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: ben-linux, ulf.hansson, adrian.hunter, vireshk, maxime.ripard,
	wens, linux, carlo, khilman
  Cc: linux-kernel, linux-arm-kernel, linux-mmc, linux-amlogic

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/sdhci-spear.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
index 8c0f884..900838b 100644
--- a/drivers/mmc/host/sdhci-spear.c
+++ b/drivers/mmc/host/sdhci-spear.c
@@ -82,6 +82,10 @@ static int sdhci_probe(struct platform_device *pdev)
 	host->hw_name = "sdhci";
 	host->ops = &sdhci_pltfm_ops;
 	host->irq = platform_get_irq(pdev, 0);
+	if (host->irq <= 0) {
+		ret = host->irq;
+		goto err_host;
+	}
 	host->quirks = SDHCI_QUIRK_BROKEN_ADMA;
 
 	sdhci = sdhci_priv(host);
-- 
2.7.4

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

* [PATCH 4/6 v2] mmc: sdhci-spear: Handle return value of platform_get_irq
@ 2017-11-18  9:33   ` Arvind Yadav
  0 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: linux-arm-kernel

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/sdhci-spear.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
index 8c0f884..900838b 100644
--- a/drivers/mmc/host/sdhci-spear.c
+++ b/drivers/mmc/host/sdhci-spear.c
@@ -82,6 +82,10 @@ static int sdhci_probe(struct platform_device *pdev)
 	host->hw_name = "sdhci";
 	host->ops = &sdhci_pltfm_ops;
 	host->irq = platform_get_irq(pdev, 0);
+	if (host->irq <= 0) {
+		ret = host->irq;
+		goto err_host;
+	}
 	host->quirks = SDHCI_QUIRK_BROKEN_ADMA;
 
 	sdhci = sdhci_priv(host);
-- 
2.7.4

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

* [PATCH 4/6 v2] mmc: sdhci-spear: Handle return value of platform_get_irq
@ 2017-11-18  9:33   ` Arvind Yadav
  0 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: linus-amlogic

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/sdhci-spear.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
index 8c0f884..900838b 100644
--- a/drivers/mmc/host/sdhci-spear.c
+++ b/drivers/mmc/host/sdhci-spear.c
@@ -82,6 +82,10 @@ static int sdhci_probe(struct platform_device *pdev)
 	host->hw_name = "sdhci";
 	host->ops = &sdhci_pltfm_ops;
 	host->irq = platform_get_irq(pdev, 0);
+	if (host->irq <= 0) {
+		ret = host->irq;
+		goto err_host;
+	}
 	host->quirks = SDHCI_QUIRK_BROKEN_ADMA;
 
 	sdhci = sdhci_priv(host);
-- 
2.7.4

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

* [PATCH 5/6 v2] mmc: sh_mmcif: Handle return value of platform_get_irq
  2017-11-18  9:33 ` Arvind Yadav
  (?)
  (?)
@ 2017-11-18  9:33   ` Arvind Yadav
  -1 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: ben-linux, ulf.hansson, adrian.hunter, vireshk, maxime.ripard,
	wens, linux, carlo, khilman
  Cc: linux-kernel, linux-arm-kernel, linux-mmc, linux-amlogic

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/sh_mmcif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 53fb18b..481f2c4 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1405,7 +1405,7 @@ static int sh_mmcif_probe(struct platform_device *pdev)
 
 	irq[0] = platform_get_irq(pdev, 0);
 	irq[1] = platform_get_irq(pdev, 1);
-	if (irq[0] < 0) {
+	if (irq[0] <= 0 || irq[1] <= 0) {
 		dev_err(dev, "Get irq error\n");
 		return -ENXIO;
 	}
-- 
2.7.4

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

* [PATCH 5/6 v2] mmc: sh_mmcif: Handle return value of platform_get_irq
@ 2017-11-18  9:33   ` Arvind Yadav
  0 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: ben-linux, ulf.hansson, adrian.hunter, vireshk, maxime.ripard,
	wens, linux, carlo, khilman
  Cc: linux-amlogic, linux-mmc, linux-kernel, linux-arm-kernel

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/sh_mmcif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 53fb18b..481f2c4 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1405,7 +1405,7 @@ static int sh_mmcif_probe(struct platform_device *pdev)
 
 	irq[0] = platform_get_irq(pdev, 0);
 	irq[1] = platform_get_irq(pdev, 1);
-	if (irq[0] < 0) {
+	if (irq[0] <= 0 || irq[1] <= 0) {
 		dev_err(dev, "Get irq error\n");
 		return -ENXIO;
 	}
-- 
2.7.4

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

* [PATCH 5/6 v2] mmc: sh_mmcif: Handle return value of platform_get_irq
@ 2017-11-18  9:33   ` Arvind Yadav
  0 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: linux-arm-kernel

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/sh_mmcif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 53fb18b..481f2c4 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1405,7 +1405,7 @@ static int sh_mmcif_probe(struct platform_device *pdev)
 
 	irq[0] = platform_get_irq(pdev, 0);
 	irq[1] = platform_get_irq(pdev, 1);
-	if (irq[0] < 0) {
+	if (irq[0] <= 0 || irq[1] <= 0) {
 		dev_err(dev, "Get irq error\n");
 		return -ENXIO;
 	}
-- 
2.7.4

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

* [PATCH 5/6 v2] mmc: sh_mmcif: Handle return value of platform_get_irq
@ 2017-11-18  9:33   ` Arvind Yadav
  0 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: linus-amlogic

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/sh_mmcif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 53fb18b..481f2c4 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1405,7 +1405,7 @@ static int sh_mmcif_probe(struct platform_device *pdev)
 
 	irq[0] = platform_get_irq(pdev, 0);
 	irq[1] = platform_get_irq(pdev, 1);
-	if (irq[0] < 0) {
+	if (irq[0] <= 0 || irq[1] <= 0) {
 		dev_err(dev, "Get irq error\n");
 		return -ENXIO;
 	}
-- 
2.7.4

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

* [PATCH 6/6 v2] mmc: sunxi-mmc: Handle return value of platform_get_irq
  2017-11-18  9:33 ` Arvind Yadav
  (?)
@ 2017-11-18  9:33   ` Arvind Yadav
  -1 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: ben-linux, ulf.hansson, adrian.hunter, vireshk, maxime.ripard,
	wens, linux, carlo, khilman
  Cc: linux-kernel, linux-arm-kernel, linux-mmc, linux-amlogic

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/sunxi-mmc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index cc98355d..ec2a16b 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -1255,6 +1255,11 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host,
 		goto error_assert_reset;
 
 	host->irq = platform_get_irq(pdev, 0);
+	if (host->irq <= 0) {
+		ret = host->irq;
+		goto error_assert_reset;
+	}
+
 	return devm_request_threaded_irq(&pdev->dev, host->irq, sunxi_mmc_irq,
 			sunxi_mmc_handle_manual_stop, 0, "sunxi-mmc", host);
 
-- 
2.7.4

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

* [PATCH 6/6 v2] mmc: sunxi-mmc: Handle return value of platform_get_irq
@ 2017-11-18  9:33   ` Arvind Yadav
  0 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: linux-arm-kernel

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/sunxi-mmc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index cc98355d..ec2a16b 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -1255,6 +1255,11 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host,
 		goto error_assert_reset;
 
 	host->irq = platform_get_irq(pdev, 0);
+	if (host->irq <= 0) {
+		ret = host->irq;
+		goto error_assert_reset;
+	}
+
 	return devm_request_threaded_irq(&pdev->dev, host->irq, sunxi_mmc_irq,
 			sunxi_mmc_handle_manual_stop, 0, "sunxi-mmc", host);
 
-- 
2.7.4

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

* [PATCH 6/6 v2] mmc: sunxi-mmc: Handle return value of platform_get_irq
@ 2017-11-18  9:33   ` Arvind Yadav
  0 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:33 UTC (permalink / raw)
  To: linus-amlogic

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

 drivers/mmc/host/sunxi-mmc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index cc98355d..ec2a16b 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -1255,6 +1255,11 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host,
 		goto error_assert_reset;
 
 	host->irq = platform_get_irq(pdev, 0);
+	if (host->irq <= 0) {
+		ret = host->irq;
+		goto error_assert_reset;
+	}
+
 	return devm_request_threaded_irq(&pdev->dev, host->irq, sunxi_mmc_irq,
 			sunxi_mmc_handle_manual_stop, 0, "sunxi-mmc", host);
 
-- 
2.7.4

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

* Re: [PATCH 4/6 v2] mmc: sdhci-spear: Handle return value of platform_get_irq
  2017-11-18  9:33   ` Arvind Yadav
  (?)
@ 2017-11-20  5:44     ` Viresh Kumar
  -1 siblings, 0 replies; 25+ messages in thread
From: Viresh Kumar @ 2017-11-20  5:44 UTC (permalink / raw)
  To: Arvind Yadav
  Cc: ben-linux, ulf.hansson, adrian.hunter, vireshk, maxime.ripard,
	wens, linux, carlo, khilman, linux-kernel, linux-arm-kernel,
	linux-mmc, linux-amlogic

On 18-11-17, 15:03, Arvind Yadav wrote:
> platform_get_irq() can fail here and we must check its return value.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> changes in v2 :
>               Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
> 
>  drivers/mmc/host/sdhci-spear.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
> index 8c0f884..900838b 100644
> --- a/drivers/mmc/host/sdhci-spear.c
> +++ b/drivers/mmc/host/sdhci-spear.c
> @@ -82,6 +82,10 @@ static int sdhci_probe(struct platform_device *pdev)
>  	host->hw_name = "sdhci";
>  	host->ops = &sdhci_pltfm_ops;
>  	host->irq = platform_get_irq(pdev, 0);
> +	if (host->irq <= 0) {
> +		ret = host->irq;
> +		goto err_host;
> +	}
>  	host->quirks = SDHCI_QUIRK_BROKEN_ADMA;
>  
>  	sdhci = sdhci_priv(host);

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

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

* [PATCH 4/6 v2] mmc: sdhci-spear: Handle return value of platform_get_irq
@ 2017-11-20  5:44     ` Viresh Kumar
  0 siblings, 0 replies; 25+ messages in thread
From: Viresh Kumar @ 2017-11-20  5:44 UTC (permalink / raw)
  To: linux-arm-kernel

On 18-11-17, 15:03, Arvind Yadav wrote:
> platform_get_irq() can fail here and we must check its return value.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> changes in v2 :
>               Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
> 
>  drivers/mmc/host/sdhci-spear.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
> index 8c0f884..900838b 100644
> --- a/drivers/mmc/host/sdhci-spear.c
> +++ b/drivers/mmc/host/sdhci-spear.c
> @@ -82,6 +82,10 @@ static int sdhci_probe(struct platform_device *pdev)
>  	host->hw_name = "sdhci";
>  	host->ops = &sdhci_pltfm_ops;
>  	host->irq = platform_get_irq(pdev, 0);
> +	if (host->irq <= 0) {
> +		ret = host->irq;
> +		goto err_host;
> +	}
>  	host->quirks = SDHCI_QUIRK_BROKEN_ADMA;
>  
>  	sdhci = sdhci_priv(host);

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

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

* [PATCH 4/6 v2] mmc: sdhci-spear: Handle return value of platform_get_irq
@ 2017-11-20  5:44     ` Viresh Kumar
  0 siblings, 0 replies; 25+ messages in thread
From: Viresh Kumar @ 2017-11-20  5:44 UTC (permalink / raw)
  To: linus-amlogic

On 18-11-17, 15:03, Arvind Yadav wrote:
> platform_get_irq() can fail here and we must check its return value.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> changes in v2 :
>               Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
> 
>  drivers/mmc/host/sdhci-spear.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
> index 8c0f884..900838b 100644
> --- a/drivers/mmc/host/sdhci-spear.c
> +++ b/drivers/mmc/host/sdhci-spear.c
> @@ -82,6 +82,10 @@ static int sdhci_probe(struct platform_device *pdev)
>  	host->hw_name = "sdhci";
>  	host->ops = &sdhci_pltfm_ops;
>  	host->irq = platform_get_irq(pdev, 0);
> +	if (host->irq <= 0) {
> +		ret = host->irq;
> +		goto err_host;
> +	}
>  	host->quirks = SDHCI_QUIRK_BROKEN_ADMA;
>  
>  	sdhci = sdhci_priv(host);

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

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

* Re: [PATCH 4/6 v2] mmc: sdhci-spear: Handle return value of platform_get_irq
  2017-11-20  5:44     ` Viresh Kumar
  (?)
@ 2017-11-20  6:45       ` Arvind Yadav
  -1 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-20  6:45 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: ben-linux, ulf.hansson, adrian.hunter, vireshk, maxime.ripard,
	wens, linux, carlo, khilman, linux-kernel, linux-arm-kernel,
	linux-mmc, linux-amlogic

Hi viresh,

Could you please acknowledge a latest version(v3) of this patch.

Thanks,


On Monday 20 November 2017 11:14 AM, Viresh Kumar wrote:
> On 18-11-17, 15:03, Arvind Yadav wrote:
>> platform_get_irq() can fail here and we must check its return value.
>>
>> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
>> ---
>> changes in v2 :
>>                Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
>>
>>   drivers/mmc/host/sdhci-spear.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
>> index 8c0f884..900838b 100644
>> --- a/drivers/mmc/host/sdhci-spear.c
>> +++ b/drivers/mmc/host/sdhci-spear.c
>> @@ -82,6 +82,10 @@ static int sdhci_probe(struct platform_device *pdev)
>>   	host->hw_name = "sdhci";
>>   	host->ops = &sdhci_pltfm_ops;
>>   	host->irq = platform_get_irq(pdev, 0);
>> +	if (host->irq <= 0) {
>> +		ret = host->irq;
>> +		goto err_host;
>> +	}
>>   	host->quirks = SDHCI_QUIRK_BROKEN_ADMA;
>>   
>>   	sdhci = sdhci_priv(host);
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
>

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

* [PATCH 4/6 v2] mmc: sdhci-spear: Handle return value of platform_get_irq
@ 2017-11-20  6:45       ` Arvind Yadav
  0 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-20  6:45 UTC (permalink / raw)
  To: linux-arm-kernel

Hi viresh,

Could you please acknowledge a latest version(v3) of this patch.

Thanks,


On Monday 20 November 2017 11:14 AM, Viresh Kumar wrote:
> On 18-11-17, 15:03, Arvind Yadav wrote:
>> platform_get_irq() can fail here and we must check its return value.
>>
>> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
>> ---
>> changes in v2 :
>>                Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
>>
>>   drivers/mmc/host/sdhci-spear.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
>> index 8c0f884..900838b 100644
>> --- a/drivers/mmc/host/sdhci-spear.c
>> +++ b/drivers/mmc/host/sdhci-spear.c
>> @@ -82,6 +82,10 @@ static int sdhci_probe(struct platform_device *pdev)
>>   	host->hw_name = "sdhci";
>>   	host->ops = &sdhci_pltfm_ops;
>>   	host->irq = platform_get_irq(pdev, 0);
>> +	if (host->irq <= 0) {
>> +		ret = host->irq;
>> +		goto err_host;
>> +	}
>>   	host->quirks = SDHCI_QUIRK_BROKEN_ADMA;
>>   
>>   	sdhci = sdhci_priv(host);
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
>

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

* [PATCH 4/6 v2] mmc: sdhci-spear: Handle return value of platform_get_irq
@ 2017-11-20  6:45       ` Arvind Yadav
  0 siblings, 0 replies; 25+ messages in thread
From: Arvind Yadav @ 2017-11-20  6:45 UTC (permalink / raw)
  To: linus-amlogic

Hi viresh,

Could you please acknowledge a latest version(v3) of this patch.

Thanks,


On Monday 20 November 2017 11:14 AM, Viresh Kumar wrote:
> On 18-11-17, 15:03, Arvind Yadav wrote:
>> platform_get_irq() can fail here and we must check its return value.
>>
>> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
>> ---
>> changes in v2 :
>>                Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
>>
>>   drivers/mmc/host/sdhci-spear.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
>> index 8c0f884..900838b 100644
>> --- a/drivers/mmc/host/sdhci-spear.c
>> +++ b/drivers/mmc/host/sdhci-spear.c
>> @@ -82,6 +82,10 @@ static int sdhci_probe(struct platform_device *pdev)
>>   	host->hw_name = "sdhci";
>>   	host->ops = &sdhci_pltfm_ops;
>>   	host->irq = platform_get_irq(pdev, 0);
>> +	if (host->irq <= 0) {
>> +		ret = host->irq;
>> +		goto err_host;
>> +	}
>>   	host->quirks = SDHCI_QUIRK_BROKEN_ADMA;
>>   
>>   	sdhci = sdhci_priv(host);
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
>

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

end of thread, other threads:[~2017-11-20  6:45 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-18  9:33 [PATCH 1/6 v2] mmc: meson-gx-mmc: Fix platform_get_irq's error checking Arvind Yadav
2017-11-18  9:33 ` Arvind Yadav
2017-11-18  9:33 ` Arvind Yadav
2017-11-18  9:33 ` [PATCH 2/6 v2] mmc: s3cmci: " Arvind Yadav
2017-11-18  9:33   ` Arvind Yadav
2017-11-18  9:33   ` Arvind Yadav
2017-11-18  9:33 ` [PATCH 3/6 v2] mmc: sdhci-acpi: Handle return value of platform_get_irq Arvind Yadav
2017-11-18  9:33   ` Arvind Yadav
2017-11-18  9:33   ` Arvind Yadav
2017-11-18  9:33 ` [PATCH 4/6 v2] mmc: sdhci-spear: " Arvind Yadav
2017-11-18  9:33   ` Arvind Yadav
2017-11-18  9:33   ` Arvind Yadav
2017-11-20  5:44   ` Viresh Kumar
2017-11-20  5:44     ` Viresh Kumar
2017-11-20  5:44     ` Viresh Kumar
2017-11-20  6:45     ` Arvind Yadav
2017-11-20  6:45       ` Arvind Yadav
2017-11-20  6:45       ` Arvind Yadav
2017-11-18  9:33 ` [PATCH 5/6 v2] mmc: sh_mmcif: " Arvind Yadav
2017-11-18  9:33   ` Arvind Yadav
2017-11-18  9:33   ` Arvind Yadav
2017-11-18  9:33   ` Arvind Yadav
2017-11-18  9:33 ` [PATCH 6/6 v2] mmc: sunxi-mmc: " Arvind Yadav
2017-11-18  9:33   ` Arvind Yadav
2017-11-18  9:33   ` Arvind Yadav

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.