All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] misc: Fix platform_get_irq's error checking
@ 2017-11-18  5:44 ` Arvind Yadav
  0 siblings, 0 replies; 8+ messages in thread
From: Arvind Yadav @ 2017-11-18  5:44 UTC (permalink / raw)
  To: arnd, gregkh, joel, nicolas.ferre, alexandre.belloni
  Cc: linux-kernel, 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.

Arvind Yadav (2):
  [PATCH 1/2] misc: aspeed-lpc-snoop: Fix platform_get_irq's error checking
  [PATCH 2/2] misc: atmel-ssc: Fix platform_get_irq's error checking

 drivers/misc/aspeed-lpc-snoop.c | 4 ++--
 drivers/misc/atmel-ssc.c        | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

-- 
2.7.4

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

* [PATCH 0/2] misc: Fix platform_get_irq's error checking
@ 2017-11-18  5:44 ` Arvind Yadav
  0 siblings, 0 replies; 8+ messages in thread
From: Arvind Yadav @ 2017-11-18  5:44 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.

Arvind Yadav (2):
  [PATCH 1/2] misc: aspeed-lpc-snoop: Fix platform_get_irq's error checking
  [PATCH 2/2] misc: atmel-ssc: Fix platform_get_irq's error checking

 drivers/misc/aspeed-lpc-snoop.c | 4 ++--
 drivers/misc/atmel-ssc.c        | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

-- 
2.7.4

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

* [PATCH 1/2] misc: aspeed-lpc-snoop: Fix platform_get_irq's error checking
  2017-11-18  5:44 ` Arvind Yadav
@ 2017-11-18  5:44   ` Arvind Yadav
  -1 siblings, 0 replies; 8+ messages in thread
From: Arvind Yadav @ 2017-11-18  5:44 UTC (permalink / raw)
  To: arnd, gregkh, joel, nicolas.ferre, alexandre.belloni
  Cc: linux-kernel, 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>
---
 drivers/misc/aspeed-lpc-snoop.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/aspeed-lpc-snoop.c b/drivers/misc/aspeed-lpc-snoop.c
index cb78c98..14c3c90 100644
--- a/drivers/misc/aspeed-lpc-snoop.c
+++ b/drivers/misc/aspeed-lpc-snoop.c
@@ -115,8 +115,8 @@ static int aspeed_lpc_snoop_config_irq(struct aspeed_lpc_snoop *lpc_snoop,
 	int rc;
 
 	lpc_snoop->irq = platform_get_irq(pdev, 0);
-	if (!lpc_snoop->irq)
-		return -ENODEV;
+	if (lpc_snoop->irq < 0)
+		return lpc_snoop->irq;
 
 	rc = devm_request_irq(dev, lpc_snoop->irq,
 			      aspeed_lpc_snoop_irq, IRQF_SHARED,
-- 
2.7.4

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

* [PATCH 1/2] misc: aspeed-lpc-snoop: Fix platform_get_irq's error checking
@ 2017-11-18  5:44   ` Arvind Yadav
  0 siblings, 0 replies; 8+ messages in thread
From: Arvind Yadav @ 2017-11-18  5:44 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>
---
 drivers/misc/aspeed-lpc-snoop.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/aspeed-lpc-snoop.c b/drivers/misc/aspeed-lpc-snoop.c
index cb78c98..14c3c90 100644
--- a/drivers/misc/aspeed-lpc-snoop.c
+++ b/drivers/misc/aspeed-lpc-snoop.c
@@ -115,8 +115,8 @@ static int aspeed_lpc_snoop_config_irq(struct aspeed_lpc_snoop *lpc_snoop,
 	int rc;
 
 	lpc_snoop->irq = platform_get_irq(pdev, 0);
-	if (!lpc_snoop->irq)
-		return -ENODEV;
+	if (lpc_snoop->irq < 0)
+		return lpc_snoop->irq;
 
 	rc = devm_request_irq(dev, lpc_snoop->irq,
 			      aspeed_lpc_snoop_irq, IRQF_SHARED,
-- 
2.7.4

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

* [PATCH 2/2] misc: atmel-ssc: Fix platform_get_irq's error checking
  2017-11-18  5:44 ` Arvind Yadav
@ 2017-11-18  5:44   ` Arvind Yadav
  -1 siblings, 0 replies; 8+ messages in thread
From: Arvind Yadav @ 2017-11-18  5:44 UTC (permalink / raw)
  To: arnd, gregkh, joel, nicolas.ferre, alexandre.belloni
  Cc: linux-kernel, 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>
---
 drivers/misc/atmel-ssc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
index b2a0340..9d9eeae 100644
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -235,9 +235,9 @@ static int ssc_probe(struct platform_device *pdev)
 	clk_disable_unprepare(ssc->clk);
 
 	ssc->irq = platform_get_irq(pdev, 0);
-	if (!ssc->irq) {
+	if (ssc->irq < 0) {
 		dev_dbg(&pdev->dev, "could not get irq\n");
-		return -ENXIO;
+		return ssc->irq;
 	}
 
 	spin_lock(&user_lock);
-- 
2.7.4

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

* [PATCH 2/2] misc: atmel-ssc: Fix platform_get_irq's error checking
@ 2017-11-18  5:44   ` Arvind Yadav
  0 siblings, 0 replies; 8+ messages in thread
From: Arvind Yadav @ 2017-11-18  5:44 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>
---
 drivers/misc/atmel-ssc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
index b2a0340..9d9eeae 100644
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -235,9 +235,9 @@ static int ssc_probe(struct platform_device *pdev)
 	clk_disable_unprepare(ssc->clk);
 
 	ssc->irq = platform_get_irq(pdev, 0);
-	if (!ssc->irq) {
+	if (ssc->irq < 0) {
 		dev_dbg(&pdev->dev, "could not get irq\n");
-		return -ENXIO;
+		return ssc->irq;
 	}
 
 	spin_lock(&user_lock);
-- 
2.7.4

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

* Re: [PATCH 0/2] misc: Fix platform_get_irq's error checking
  2017-11-18  5:44 ` Arvind Yadav
@ 2017-11-18  8:16   ` Russell King - ARM Linux
  -1 siblings, 0 replies; 8+ messages in thread
From: Russell King - ARM Linux @ 2017-11-18  8:16 UTC (permalink / raw)
  To: Arvind Yadav
  Cc: arnd, gregkh, joel, nicolas.ferre, alexandre.belloni,
	linux-kernel, linux-arm-kernel

On Sat, Nov 18, 2017 at 11:14:25AM +0530, Arvind Yadav wrote:
> 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.

The failure case is <= 0, not < 0, as IRQ0 is not a valid interrupt.
Please rework your patches for this.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

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

* [PATCH 0/2] misc: Fix platform_get_irq's error checking
@ 2017-11-18  8:16   ` Russell King - ARM Linux
  0 siblings, 0 replies; 8+ messages in thread
From: Russell King - ARM Linux @ 2017-11-18  8:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Nov 18, 2017 at 11:14:25AM +0530, Arvind Yadav wrote:
> 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.

The failure case is <= 0, not < 0, as IRQ0 is not a valid interrupt.
Please rework your patches for this.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync@8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

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

end of thread, other threads:[~2017-11-18  8:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-18  5:44 [PATCH 0/2] misc: Fix platform_get_irq's error checking Arvind Yadav
2017-11-18  5:44 ` Arvind Yadav
2017-11-18  5:44 ` [PATCH 1/2] misc: aspeed-lpc-snoop: " Arvind Yadav
2017-11-18  5:44   ` Arvind Yadav
2017-11-18  5:44 ` [PATCH 2/2] misc: atmel-ssc: " Arvind Yadav
2017-11-18  5:44   ` Arvind Yadav
2017-11-18  8:16 ` [PATCH 0/2] misc: " Russell King - ARM Linux
2017-11-18  8:16   ` Russell King - ARM Linux

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.