openvortex-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Openvortex-dev] [PATCH 2/6] au88x0: fix is-quad oops


From: Jeff Muizelaar
Subject: [Openvortex-dev] [PATCH 2/6] au88x0: fix is-quad oops
Date: Sun, 24 Oct 2004 18:09:22 -0400

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 <address@hidden>

diff -ur 2.6.10-resetup/sound/pci/au88x0/au88x0.h 
working/sound/pci/au88x0/au88x0.h
--- 2.6.10-resetup/sound/pci/au88x0/au88x0.h    2004-10-23 21:01:38 -0400
+++ working/sound/pci/au88x0/au88x0.h   2004-10-23 21:03:07 -0400
@@ -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 @@
        int xt_mode;            /* 1: speakers, 0:headphones. */
 #endif
 
+       int isquad;             /* cache of extended ID codec flag. */
+
        /* Gameport stuff. */
        struct gameport *gameport;
 
diff -ur 2.6.10-resetup/sound/pci/au88x0/au88x0.h.orig 
working/sound/pci/au88x0/au88x0.h.orig
--- 2.6.10-resetup/sound/pci/au88x0/au88x0.h.orig       2004-10-23 16:37:21 
-0400
+++ working/sound/pci/au88x0/au88x0.h.orig      2004-10-23 21:01:38 -0400
@@ -208,6 +208,7 @@
 static void vortex_adbdma_pausefifo(vortex_t * vortex, int adbdma);
 static void vortex_adbdma_resumefifo(vortex_t * vortex, int adbdma);
 static int inline vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma);
+void vortex_adbdma_resetup(vortex_t *vortex, int adbdma);
 
 #ifndef CHIP_AU8810
 static void vortex_wtdma_startfifo(vortex_t * vortex, int wtdma);
diff -ur 2.6.10-resetup/sound/pci/au88x0/au88x0_mixer.c 
working/sound/pci/au88x0/au88x0_mixer.c
--- 2.6.10-resetup/sound/pci/au88x0/au88x0_mixer.c      2004-10-23 16:37:21 
-0400
+++ working/sound/pci/au88x0/au88x0_mixer.c     2004-10-23 21:03:07 -0400
@@ -26,5 +26,7 @@
        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;
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]