All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] MIPS: ralink: Fix platform_get_irq's error checking
@ 2017-11-23 15:45 Arvind Yadav
  2017-11-23 18:38 ` Sergei Shtylyov
  0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-11-23 15:45 UTC (permalink / raw)
  To: john, ralf; +Cc: linux-kernel, linux-mips

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: Subject spelling was not correct. change FIX in place
               of 'ix'.

 arch/mips/ralink/timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/ralink/timer.c b/arch/mips/ralink/timer.c
index d4469b2..913dc84b 100644
--- a/arch/mips/ralink/timer.c
+++ b/arch/mips/ralink/timer.c
@@ -109,7 +109,7 @@ static int rt_timer_probe(struct platform_device *pdev)
 	}
 
 	rt->irq = platform_get_irq(pdev, 0);
-	if (!rt->irq) {
+	if (rt->irq < 0) {
 		dev_err(&pdev->dev, "failed to load irq\n");
 		return -ENOENT;
 	}
-- 
2.7.4

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

* Re: [PATCH v2] MIPS: ralink: Fix platform_get_irq's error checking
  2017-11-23 15:45 [PATCH v2] MIPS: ralink: Fix platform_get_irq's error checking Arvind Yadav
@ 2017-11-23 18:38 ` Sergei Shtylyov
  0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2017-11-23 18:38 UTC (permalink / raw)
  To: Arvind Yadav, john, ralf; +Cc: linux-kernel, linux-mips

On 11/23/2017 06:45 PM, 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: Subject spelling was not correct. change FIX in place
>                 of 'ix'.
> 
>   arch/mips/ralink/timer.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/mips/ralink/timer.c b/arch/mips/ralink/timer.c
> index d4469b2..913dc84b 100644
> --- a/arch/mips/ralink/timer.c
> +++ b/arch/mips/ralink/timer.c
> @@ -109,7 +109,7 @@ static int rt_timer_probe(struct platform_device *pdev)
>   	}
>   
>   	rt->irq = platform_get_irq(pdev, 0);
> -	if (!rt->irq) {
> +	if (rt->irq < 0) {
>   		dev_err(&pdev->dev, "failed to load irq\n");
>   		return -ENOENT;

    Also makes sense to propagate the error instead of -ENOENT...

[...]

MBR, Sergei

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-23 15:45 [PATCH v2] MIPS: ralink: Fix platform_get_irq's error checking Arvind Yadav
2017-11-23 18:38 ` Sergei Shtylyov

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.