aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@suse.cz>2004-10-29 21:09:28 +0200
committerJaroslav Kysela <perex@suse.cz>2004-10-29 21:09:28 +0200
commitd3ddb1057a63366f0c7e7d66acfd847b25a60418 (patch)
treeaf4d29e9d994448cd3a1823f30606e5fb323062b /sound
parent230316ec9361781d412079a033fb701432633aac (diff)
downloadhistory-d3ddb1057a63366f0c7e7d66acfd847b25a60418.tar.gz
[ALSA] au88x0: fix is-quad oops
au88x0 driver Fixes an oops on module removal caused by dereferencing the codec pointer. This is not the best solution, but it is the easiest and fixes things for now. Signed-off-by: Jeff Muizelaar <muizelaar@rogers.com> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/au88x0/au88x0.h5
-rw-r--r--sound/pci/au88x0/au88x0_mixer.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/sound/pci/au88x0/au88x0.h b/sound/pci/au88x0/au88x0.h
index aed3e853d9e685..d573d9c171b1e5 100644
--- a/sound/pci/au88x0/au88x0.h
+++ b/sound/pci/au88x0/au88x0.h
@@ -80,7 +80,8 @@
#define VORTEX_RESOURCE_LAST 0x00000005
/* Check for SDAC bit in "Extended audio ID" AC97 register */
-#define VORTEX_IS_QUAD(x) ((x->codec == NULL) ? 0 : (x->codec->ext_id&0x80))
+//#define VORTEX_IS_QUAD(x) (((x)->codec == NULL) ? 0 : ((x)->codec->ext_id&0x80))
+#define VORTEX_IS_QUAD(x) ((x)->isquad)
/* Check if chip has bug. */
#define IS_BAD_CHIP(x) (\
(x->rev == 0xfe && x->device == PCI_DEVICE_ID_AUREAL_VORTEX_2) || \
@@ -164,6 +165,8 @@ struct snd_vortex {
int xt_mode; /* 1: speakers, 0:headphones. */
#endif
+ int isquad; /* cache of extended ID codec flag. */
+
/* Gameport stuff. */
struct gameport *gameport;
diff --git a/sound/pci/au88x0/au88x0_mixer.c b/sound/pci/au88x0/au88x0_mixer.c
index 477b2d15ba5e74..95ed26ead5c516 100644
--- a/sound/pci/au88x0/au88x0_mixer.c
+++ b/sound/pci/au88x0/au88x0_mixer.c
@@ -26,5 +26,7 @@ static int __devinit snd_vortex_mixer(vortex_t * vortex)
memset(&ac97, 0, sizeof(ac97));
// Intialize AC97 codec stuff.
ac97.private_data = vortex;
- return snd_ac97_mixer(pbus, &ac97, &vortex->codec);
+ err = snd_ac97_mixer(pbus, &ac97, &vortex->codec);
+ vortex->isquad = ((vortex->codec == NULL) ? 0 : (vortex->codec->ext_id&0x80));
+ return err;
}