lkml.org 
[lkml]   [2017]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/5 v4] ASoC: nuc900: Fix platform_get_irq's error checking
Date
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 :
irq was unsigned. so using signed variable ret.
changes in v3 :
Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
changes in v4 :
Return -ENODEV insted of irq.
sound/soc/nuc900/nuc900-ac97.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c
index b6615af..893ccf2 100644
--- a/sound/soc/nuc900/nuc900-ac97.c
+++ b/sound/soc/nuc900/nuc900-ac97.c
@@ -345,11 +345,12 @@ static int nuc900_ac97_drvprobe(struct platform_device *pdev)
goto out;
}

- nuc900_audio->irq_num = platform_get_irq(pdev, 0);
- if (!nuc900_audio->irq_num) {
+ ret = platform_get_irq(pdev, 0);
+ if (ret <= 0) {
ret = -EBUSY;
goto out;
}
+ nuc900_audio->irq_num = ret;

nuc900_ac97_data = nuc900_audio;

--
2.7.4
\
 
 \ /
  Last update: 2017-11-19 05:17    [W:0.108 / U:1.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site