[alsa-devel] [patch 2/2] ALSA: cs4236: fix pnp_irq() error handling

Dan Carpenter dan.carpenter at oracle.com
Thu Nov 7 09:18:45 CET 2013


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 at 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 */


More information about the Alsa-devel mailing list