summaryrefslogtreecommitdiffstats
path: root/sound/pci/rme96.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-06-06 15:44:34 +0200
committerJaroslav Kysela <perex@suse.cz>2006-06-22 21:34:13 +0200
commit688956f23bdbfb1c3551bfafc819f989b36bb8ae (patch)
treeae59fdf7662b5a27c66554cbfd2b67c49fc156da /sound/pci/rme96.c
parentc5533bf36b4a6629dab0e08c4951247050928853 (diff)
downloadop-kernel-dev-688956f23bdbfb1c3551bfafc819f989b36bb8ae.zip
op-kernel-dev-688956f23bdbfb1c3551bfafc819f989b36bb8ae.tar.gz
[ALSA] Fix races in irq handler and ioremap
Call ioremap before request_irq for avoiding possible races in the irq handler. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/rme96.c')
-rw-r--r--sound/pci/rme96.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index 65611a7..991cb18 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -1583,17 +1583,17 @@ snd_rme96_create(struct rme96 *rme96)
return err;
rme96->port = pci_resource_start(rme96->pci, 0);
+ if ((rme96->iobase = ioremap_nocache(rme96->port, RME96_IO_SIZE)) == 0) {
+ snd_printk(KERN_ERR "unable to remap memory region 0x%lx-0x%lx\n", rme96->port, rme96->port + RME96_IO_SIZE - 1);
+ return -ENOMEM;
+ }
+
if (request_irq(pci->irq, snd_rme96_interrupt, SA_INTERRUPT|SA_SHIRQ, "RME96", (void *)rme96)) {
snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
return -EBUSY;
}
rme96->irq = pci->irq;
- if ((rme96->iobase = ioremap_nocache(rme96->port, RME96_IO_SIZE)) == 0) {
- snd_printk(KERN_ERR "unable to remap memory region 0x%lx-0x%lx\n", rme96->port, rme96->port + RME96_IO_SIZE - 1);
- return -ENOMEM;
- }
-
/* read the card's revision number */
pci_read_config_byte(pci, 8, &rme96->rev);
OpenPOWER on IntegriCloud