public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 2/2] ALSA: cs4236: fix pnp_irq() error handling
@ 2013-11-07  8:18 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2013-11-07  8:18 UTC (permalink / raw)
  To: Jaroslav Kysela, Andrew Morton
  Cc: Takashi Iwai, alsa-devel, Bill Pemberton, kernel-janitors

pnp_irq() returns an unsigned value so the error handling here doesn't
work.  I recently introduced a IORESOURCE_INVALID define to make this
less confusing.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This needs [patch 1/2] or it won't compile.  Can both patches go through
Andrew's tree?

diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c
index 69614ac..9725843 100644
--- a/sound/isa/cs423x/cs4236.c
+++ b/sound/isa/cs423x/cs4236.c
@@ -293,7 +293,8 @@ static int snd_cs423x_pnp_init_mpu(int dev, struct pnp_dev *pdev)
 	} else {
 		mpu_port[dev] = pnp_port_start(pdev, 0);
 		if (mpu_irq[dev] >= 0 &&
-		    pnp_irq_valid(pdev, 0) && pnp_irq(pdev, 0) >= 0) {
+		    pnp_irq_valid(pdev, 0) &&
+		    pnp_irq(pdev, 0) != IORESOURCE_INVALID) {
 			mpu_irq[dev] = pnp_irq(pdev, 0);
 		} else {
 			mpu_irq[dev] = -1;	/* disable interrupt */

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-07  8:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-07  8:18 [patch 2/2] ALSA: cs4236: fix pnp_irq() error handling Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox