aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/cs423x
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2011-09-13 05:24:41 -0400
committerTakashi Iwai <tiwai@suse.de>2011-09-14 05:00:51 -0400
commitdba8b46992c55946d3b092934f581a343403118f (patch)
tree7ea5af971bc5cc8ecf4c8af1e0547fa11291ba86 /sound/isa/cs423x
parent47124373b59e43fd07cbf7b44d9288f19c1d5a93 (diff)
ALSA: mpu401: clean up interrupt specification
The semantics of snd_mpu401_uart_new()'s interrupt parameters are somewhat counterintuitive: To prevent the function from allocating its own interrupt, either the irq number must be invalid, or the irq_flags parameter must be zero. At the same time, the irq parameter being invalid specifies that the mpu401 code has to work without an interrupt allocated by the caller. This implies that, if there is an interrupt and it is allocated by the caller, the irq parameter must be set to a valid-looking number which then isn't actually used. With the removal of IRQF_DISABLED, zero becomes a valid irq_flags value, which forces us to handle the parameters differently. This patch introduces a new flag MPU401_INFO_IRQ_HOOK for when the device interrupt is handled by the caller, and makes the allocation of the interrupt to depend only on the irq parameter. As suggested by Takashi, the irq_flags parameter was dropped because, when used, it had the constant value IRQF_DISABLED. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa/cs423x')
-rw-r--r--sound/isa/cs423x/cs4231.c1
-rw-r--r--sound/isa/cs423x/cs4236.c3
2 files changed, 1 insertions, 3 deletions
diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c
index cb9153e75b82..409fa0ad7843 100644
--- a/sound/isa/cs423x/cs4231.c
+++ b/sound/isa/cs423x/cs4231.c
@@ -131,7 +131,6 @@ static int __devinit snd_cs4231_probe(struct device *dev, unsigned int n)
131 mpu_irq[n] = -1; 131 mpu_irq[n] = -1;
132 if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232, 132 if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232,
133 mpu_port[n], 0, mpu_irq[n], 133 mpu_port[n], 0, mpu_irq[n],
134 mpu_irq[n] >= 0 ? IRQF_DISABLED : 0,
135 NULL) < 0) 134 NULL) < 0)
136 dev_warn(dev, "MPU401 not detected\n"); 135 dev_warn(dev, "MPU401 not detected\n");
137 } 136 }
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c
index 999dc1e0fdbd..0dbde461e6c1 100644
--- a/sound/isa/cs423x/cs4236.c
+++ b/sound/isa/cs423x/cs4236.c
@@ -449,8 +449,7 @@ static int __devinit snd_cs423x_probe(struct snd_card *card, int dev)
449 mpu_irq[dev] = -1; 449 mpu_irq[dev] = -1;
450 if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232, 450 if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232,
451 mpu_port[dev], 0, 451 mpu_port[dev], 0,
452 mpu_irq[dev], 452 mpu_irq[dev], NULL) < 0)
453 mpu_irq[dev] >= 0 ? IRQF_DISABLED : 0, NULL) < 0)
454 printk(KERN_WARNING IDENT ": MPU401 not detected\n"); 453 printk(KERN_WARNING IDENT ": MPU401 not detected\n");
455 } 454 }
456 455