* [PATCH 1/2 v3] misc: aspeed-lpc-snoop: Fix platform_get_irq's error checking
@ 2017-11-19 4:34 ` Arvind Yadav
0 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-11-19 4:34 UTC (permalink / raw)
To: arnd, gregkh, joel, nicolas.ferre, alexandre.belloni, linux
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>
---
changes in v2 :
Add failure case '<= 0' instead of '< 0'. IRQ 0 is not valid.
changes in v3:
Return -ENODEV instead of lpc_snoop->irq.
drivers/misc/aspeed-lpc-snoop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/aspeed-lpc-snoop.c b/drivers/misc/aspeed-lpc-snoop.c
index cb78c98..e3be88f 100644
--- a/drivers/misc/aspeed-lpc-snoop.c
+++ b/drivers/misc/aspeed-lpc-snoop.c
@@ -115,7 +115,7 @@ 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)
+ if (lpc_snoop->irq <= 0)
return -ENODEV;
rc = devm_request_irq(dev, lpc_snoop->irq,
--
2.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 1/2 v3] misc: aspeed-lpc-snoop: Fix platform_get_irq's error checking
@ 2017-11-19 4:34 ` Arvind Yadav
0 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-11-19 4:34 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'. IRQ 0 is not valid.
changes in v3:
Return -ENODEV instead of lpc_snoop->irq.
drivers/misc/aspeed-lpc-snoop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/aspeed-lpc-snoop.c b/drivers/misc/aspeed-lpc-snoop.c
index cb78c98..e3be88f 100644
--- a/drivers/misc/aspeed-lpc-snoop.c
+++ b/drivers/misc/aspeed-lpc-snoop.c
@@ -115,7 +115,7 @@ 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)
+ if (lpc_snoop->irq <= 0)
return -ENODEV;
rc = devm_request_irq(dev, lpc_snoop->irq,
--
2.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/2 v3] misc: atmel-ssc: Fix platform_get_irq's error checking
2017-11-19 4:34 ` Arvind Yadav
@ 2017-11-19 4:34 ` Arvind Yadav
-1 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-11-19 4:34 UTC (permalink / raw)
To: arnd, gregkh, joel, nicolas.ferre, alexandre.belloni, linux
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>
---
changes in v2 :
Add failure case '<= 0' instead of '< 0'. IRQ 0 is not valid.
changes in v3:
Return -ENODEV instead of ssc->irq.
drivers/misc/atmel-ssc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
index b2a0340..2ec0f9e 100644
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -235,7 +235,7 @@ 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;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/2 v3] misc: atmel-ssc: Fix platform_get_irq's error checking
@ 2017-11-19 4:34 ` Arvind Yadav
0 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-11-19 4:34 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'. IRQ 0 is not valid.
changes in v3:
Return -ENODEV instead of ssc->irq.
drivers/misc/atmel-ssc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
index b2a0340..2ec0f9e 100644
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -235,7 +235,7 @@ 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;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2 v3] misc: aspeed-lpc-snoop: Fix platform_get_irq's error checking
2017-11-19 4:34 ` Arvind Yadav
@ 2017-11-19 8:38 ` Alexandre Belloni
-1 siblings, 0 replies; 10+ messages in thread
From: Alexandre Belloni @ 2017-11-19 8:38 UTC (permalink / raw)
To: Arvind Yadav
Cc: arnd, gregkh, joel, nicolas.ferre, linux, linux-kernel, linux-arm-kernel
On 19/11/2017 at 10:04:00 +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.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> changes in v2 :
> Add failure case '<= 0' instead of '< 0'. IRQ 0 is not valid.
> changes in v3:
> Return -ENODEV instead of lpc_snoop->irq.
What about -EPROBE_DEFER?
>
> drivers/misc/aspeed-lpc-snoop.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/aspeed-lpc-snoop.c b/drivers/misc/aspeed-lpc-snoop.c
> index cb78c98..e3be88f 100644
> --- a/drivers/misc/aspeed-lpc-snoop.c
> +++ b/drivers/misc/aspeed-lpc-snoop.c
> @@ -115,7 +115,7 @@ 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)
> + if (lpc_snoop->irq <= 0)
> return -ENODEV;
>
> rc = devm_request_irq(dev, lpc_snoop->irq,
> --
> 2.7.4
>
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2 v3] misc: aspeed-lpc-snoop: Fix platform_get_irq's error checking
@ 2017-11-19 8:38 ` Alexandre Belloni
0 siblings, 0 replies; 10+ messages in thread
From: Alexandre Belloni @ 2017-11-19 8:38 UTC (permalink / raw)
To: linux-arm-kernel
On 19/11/2017 at 10:04:00 +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.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> changes in v2 :
> Add failure case '<= 0' instead of '< 0'. IRQ 0 is not valid.
> changes in v3:
> Return -ENODEV instead of lpc_snoop->irq.
What about -EPROBE_DEFER?
>
> drivers/misc/aspeed-lpc-snoop.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/aspeed-lpc-snoop.c b/drivers/misc/aspeed-lpc-snoop.c
> index cb78c98..e3be88f 100644
> --- a/drivers/misc/aspeed-lpc-snoop.c
> +++ b/drivers/misc/aspeed-lpc-snoop.c
> @@ -115,7 +115,7 @@ 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)
> + if (lpc_snoop->irq <= 0)
> return -ENODEV;
>
> rc = devm_request_irq(dev, lpc_snoop->irq,
> --
> 2.7.4
>
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2 v3] misc: atmel-ssc: Fix platform_get_irq's error checking
2017-11-19 4:34 ` Arvind Yadav
@ 2017-11-19 8:39 ` Alexandre Belloni
-1 siblings, 0 replies; 10+ messages in thread
From: Alexandre Belloni @ 2017-11-19 8:39 UTC (permalink / raw)
To: Arvind Yadav
Cc: arnd, gregkh, joel, nicolas.ferre, linux, linux-kernel, linux-arm-kernel
On 19/11/2017 at 10:04:01 +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.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> changes in v2 :
> Add failure case '<= 0' instead of '< 0'. IRQ 0 is not valid.
> changes in v3:
> Return -ENODEV instead of ssc->irq.
The patch is not doing what you claim here.
>
> drivers/misc/atmel-ssc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
> index b2a0340..2ec0f9e 100644
> --- a/drivers/misc/atmel-ssc.c
> +++ b/drivers/misc/atmel-ssc.c
> @@ -235,7 +235,7 @@ 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;
> }
> --
> 2.7.4
>
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/2 v3] misc: atmel-ssc: Fix platform_get_irq's error checking
@ 2017-11-19 8:39 ` Alexandre Belloni
0 siblings, 0 replies; 10+ messages in thread
From: Alexandre Belloni @ 2017-11-19 8:39 UTC (permalink / raw)
To: linux-arm-kernel
On 19/11/2017 at 10:04:01 +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.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> changes in v2 :
> Add failure case '<= 0' instead of '< 0'. IRQ 0 is not valid.
> changes in v3:
> Return -ENODEV instead of ssc->irq.
The patch is not doing what you claim here.
>
> drivers/misc/atmel-ssc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
> index b2a0340..2ec0f9e 100644
> --- a/drivers/misc/atmel-ssc.c
> +++ b/drivers/misc/atmel-ssc.c
> @@ -235,7 +235,7 @@ 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;
> }
> --
> 2.7.4
>
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2 v3] misc: atmel-ssc: Fix platform_get_irq's error checking
2017-11-19 4:34 ` Arvind Yadav
@ 2017-11-20 9:08 ` Nicolas Ferre
-1 siblings, 0 replies; 10+ messages in thread
From: Nicolas Ferre @ 2017-11-20 9:08 UTC (permalink / raw)
To: Arvind Yadav, arnd, gregkh, joel, alexandre.belloni, linux
Cc: linux-kernel, linux-arm-kernel
On 19/11/2017 at 05:34, 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.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> changes in v2 :
> Add failure case '<= 0' instead of '< 0'. IRQ 0 is not valid.
> changes in v3:
> Return -ENODEV instead of ssc->irq.
Okay, I didn't see this v3 before commenting on v2...
>
> drivers/misc/atmel-ssc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
> index b2a0340..2ec0f9e 100644
> --- a/drivers/misc/atmel-ssc.c
> +++ b/drivers/misc/atmel-ssc.c
> @@ -235,7 +235,7 @@ 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;
> }
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/2 v3] misc: atmel-ssc: Fix platform_get_irq's error checking
@ 2017-11-20 9:08 ` Nicolas Ferre
0 siblings, 0 replies; 10+ messages in thread
From: Nicolas Ferre @ 2017-11-20 9:08 UTC (permalink / raw)
To: linux-arm-kernel
On 19/11/2017 at 05:34, 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.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> changes in v2 :
> Add failure case '<= 0' instead of '< 0'. IRQ 0 is not valid.
> changes in v3:
> Return -ENODEV instead of ssc->irq.
Okay, I didn't see this v3 before commenting on v2...
>
> drivers/misc/atmel-ssc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
> index b2a0340..2ec0f9e 100644
> --- a/drivers/misc/atmel-ssc.c
> +++ b/drivers/misc/atmel-ssc.c
> @@ -235,7 +235,7 @@ 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;
> }
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2017-11-20 9:08 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-19 4:34 [PATCH 1/2 v3] misc: aspeed-lpc-snoop: Fix platform_get_irq's error checking Arvind Yadav
2017-11-19 4:34 ` Arvind Yadav
2017-11-19 4:34 ` [PATCH 2/2 v3] misc: atmel-ssc: " Arvind Yadav
2017-11-19 4:34 ` Arvind Yadav
2017-11-19 8:39 ` Alexandre Belloni
2017-11-19 8:39 ` Alexandre Belloni
2017-11-20 9:08 ` Nicolas Ferre
2017-11-20 9:08 ` Nicolas Ferre
2017-11-19 8:38 ` [PATCH 1/2 v3] misc: aspeed-lpc-snoop: " Alexandre Belloni
2017-11-19 8:38 ` Alexandre Belloni
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.