patch-2.1.77 linux/drivers/sound/soundmodule.h

Next file: linux/drivers/sound/sscape.c
Previous file: linux/drivers/sound/soundcard.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.76/linux/drivers/sound/soundmodule.h linux/drivers/sound/soundmodule.h
@@ -5,19 +5,21 @@
 
 #include <linux/notifier.h>
 
-#ifdef SOUND_CORE
+extern struct notifier_block *sound_locker;
+extern void sound_notifier_chain_register(struct notifier_block *);
+extern int lock_depth;
 
-struct notifier_block *sound_locker=(struct notifier_block *)0;
+#ifdef SOUND_CORE
 
-#define SOUND_INC_USE_COUNT	notifier_call_chain(&sound_locker, 1, 0)
-#define SOUND_DEC_USE_COUNT	notifier_call_chain(&sound_locker, 0, 0)
+#define SOUND_INC_USE_COUNT	do { notifier_call_chain(&sound_locker, 1, 0); lock_depth++; } while(0);
+#define SOUND_DEC_USE_COUNT	do { notifier_call_chain(&sound_locker, 0, 0); lock_depth--; } while(0);
 
 #else
 
-#define SOUND_LOCK		notifier_chain_register(&sound_locker, &sound_notifier)
+
+#define SOUND_LOCK		sound_notifier_chain_register(&sound_notifier); 
 #define SOUND_LOCK_END		notifier_chain_unregister(&sound_locker, &sound_notifier)
 
-extern struct notifier_block *sound_locker;
 
 
 static int my_notifier_call(struct notifier_block *b, unsigned long foo, void *bar)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov