Skip to contentSkip to conversation

ALSA fixes

GIT PULL Takashi Iwai 1 participant 1 message Jun 23, 2008 Sound

lore
Share & tools
lore
#0 lore raw

Linus,

please pull ALSA updates from:

git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git for-linus

which contains the following two trivial fixes.

Thanks!

Takashi

===

Takashi Iwai (2):
ALSA: aw2 - Fix Oops at initialization
ALSA: sb - Fix wrong assertions

 sound/isa/sb/sb_mixer.c  |    4 ++--
 sound/pci/aw2/aw2-alsa.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
sound/isa/sb/sb_mixer.c +2 -2
index 91d1422..73d4572 100644
@@ -925,7 +925,7 @@ static unsigned char als4000_saved_regs[] = {
 static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
 {
 	unsigned char *val = chip->saved_regs;
-	snd_assert(num_regs > ARRAY_SIZE(chip->saved_regs), return);
+	snd_assert(num_regs <= ARRAY_SIZE(chip->saved_regs), return);
 	for (; num_regs; num_regs--)
 		*val++ = snd_sbmixer_read(chip, *regs++);
 }
@@ -933,7 +933,7 @@ static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
 static void restore_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
 {
 	unsigned char *val = chip->saved_regs;
-	snd_assert(num_regs > ARRAY_SIZE(chip->saved_regs), return);
+	snd_assert(num_regs <= ARRAY_SIZE(chip->saved_regs), return);
 	for (; num_regs; num_regs--)
 		snd_sbmixer_write(chip, *regs++, *val++);
 }
sound/pci/aw2/aw2-alsa.c +2 -2
index 56f87cd..3f00ddf 100644
@@ -316,6 +316,8 @@ static int __devinit snd_aw2_create(struct snd_card *card,
 		return -ENOMEM;
 	}
 
+	/* (2) initialization of the chip hardware */
+	snd_aw2_saa7146_setup(&chip->saa7146, chip->iobase_virt);
 
 	if (request_irq(pci->irq, snd_aw2_saa7146_interrupt,
 			IRQF_SHARED, "Audiowerk2", chip)) {
@@ -329,8 +331,6 @@ static int __devinit snd_aw2_create(struct snd_card *card,
 	}
 	chip->irq = pci->irq;
 
-	/* (2) initialization of the chip hardware */
-	snd_aw2_saa7146_setup(&chip->saa7146, chip->iobase_virt);
 	err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
 	if (err < 0) {
 		free_irq(chip->irq, (void *)chip);