[ALSA] Fix Oops at rmmod with CONFIG_SND_VERBOSE_PROCFS=n

Fixed Oops at rmmod with CONFIG_SND_VERBOSE_PROCFS=n.
Add ifdef to struct fields for optimization and better compile
checks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai
2006-04-25 12:56:04 +02:00
committed by Jaroslav Kysela
parent 61fb63c096
commit b7d90a356a
6 changed files with 20 additions and 12 deletions

View File

@ -100,8 +100,10 @@ static void snd_pcm_lib_preallocate_dma_free(struct snd_pcm_substream *substream
int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream)
{
snd_pcm_lib_preallocate_dma_free(substream);
#ifdef CONFIG_SND_VERBOSE_PROCFS
snd_info_unregister(substream->proc_prealloc_entry);
substream->proc_prealloc_entry = NULL;
#endif
return 0;
}
@ -124,7 +126,7 @@ int snd_pcm_lib_preallocate_free_for_all(struct snd_pcm *pcm)
return 0;
}
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_SND_VERBOSE_PROCFS
/*
* read callback for prealloc proc file
*
@ -203,9 +205,9 @@ static inline void preallocate_info_init(struct snd_pcm_substream *substream)
substream->proc_prealloc_entry = entry;
}
#else /* !CONFIG_PROC_FS */
#else /* !CONFIG_SND_VERBOSE_PROCFS */
#define preallocate_info_init(s)
#endif
#endif /* CONFIG_SND_VERBOSE_PROCFS */
/*
* pre-allocate the buffer and create a proc file for the substream