All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen@asianux.com>
To: lgirdwood@gmail.com, Mark Brown <broonie@kernel.org>,
	perex@perex.cz, Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: [PATCH v2] sound/soc/fsl/fsl_ssi.c: let check zero instead of check NO_IRQ
Date: Mon, 23 Sep 2013 11:36:21 +0800	[thread overview]
Message-ID: <523FB735.2060906@asianux.com> (raw)
In-Reply-To: <523FB6F4.60803@asianux.com>

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(-)

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;
 	}
-- 
1.7.7.6

  reply	other threads:[~2013-09-23  3:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-23  3:24 [PATCH] sound/soc/fsl/fsl_ssi.c: let checking none-zero instead of checking NO_IRQ Chen Gang
2013-09-23  3:35 ` Chen Gang
2013-09-23  3:36   ` Chen Gang [this message]
2013-09-26 10:29     ` [PATCH v2] sound/soc/fsl/fsl_ssi.c: let check zero instead of check NO_IRQ Mark Brown
2013-09-26 10:29       ` Mark Brown
2013-09-26 10:40       ` Chen Gang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=523FB735.2060906@asianux.com \
    --to=gang.chen@asianux.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.