diff mbox

[v2] sound/soc/fsl/fsl_ssi.c: let check zero instead of check NO_IRQ

Message ID 523FB735.2060906@asianux.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Chen Gang Sept. 23, 2013, 3:36 a.m. UTC
NO_IRQ may be defined as '(unsigned int) -1' in some architectures
(arm, sh ...), and either may not be defined in some architectures
which can enable SND_SOC_FSL_SSI (e.g. allmodconfig for arc).

When irq_of_parse_and_map() fails, it will always return 0, so need
check zero instead of NO_IRQ, or will cause compiling issue or run
time bug in some architectures.


Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 sound/soc/fsl/fsl_ssi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Mark Brown Sept. 26, 2013, 10:29 a.m. UTC | #1
On Mon, Sep 23, 2013 at 11:36:21AM +0800, Chen Gang wrote:
> NO_IRQ may be defined as '(unsigned int) -1' in some architectures
> (arm, sh ...), and either may not be defined in some architectures
> which can enable SND_SOC_FSL_SSI (e.g. allmodconfig for arc).

Applied, thanks.
Chen Gang Sept. 26, 2013, 10:40 a.m. UTC | #2
On 09/26/2013 06:29 PM, Mark Brown wrote:
> On Mon, Sep 23, 2013 at 11:36:21AM +0800, Chen Gang wrote:
>> NO_IRQ may be defined as '(unsigned int) -1' in some architectures
>> (arm, sh ...), and either may not be defined in some architectures
>> which can enable SND_SOC_FSL_SSI (e.g. allmodconfig for arc).
> 
> Applied, thanks.
> 

Thank you too.  :-)
diff mbox

Patch

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 6ac8730..6c17d3e 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -936,7 +936,7 @@  static int fsl_ssi_probe(struct platform_device *pdev)
 	ssi_private->ssi_phys = res.start;
 
 	ssi_private->irq = irq_of_parse_and_map(np, 0);
-	if (ssi_private->irq == NO_IRQ) {
+	if (!ssi_private->irq) {
 		dev_err(&pdev->dev, "no irq for node %s\n", np->full_name);
 		return -ENXIO;
 	}