diff options
Diffstat (limited to 'drivers/sound/soundmodule.h')
-rw-r--r-- | drivers/sound/soundmodule.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/sound/soundmodule.h b/drivers/sound/soundmodule.h index d590acc0b..dac6316bb 100644 --- a/drivers/sound/soundmodule.h +++ b/drivers/sound/soundmodule.h @@ -1,23 +1,25 @@ #ifndef _SOUNDMODULE_H #define _SOUNDMODULE_H -#ifdef MODULE - #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 MODULE -#define SOUND_INC_USE_COUNT notifier_call_chain(&sound_locker, 1, 0) -#define SOUND_DEC_USE_COUNT notifier_call_chain(&sound_locker, 0, 0) +#ifdef SOUND_CORE + +#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) |