aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-04-25 06:56:04 -0400
committerJaroslav Kysela <perex@suse.cz>2006-04-27 15:10:42 -0400
commitb7d90a356a43f4609bd6290fc2e1ca4ef79d4458 (patch)
treed367d029a9d4894c9153c75384161758388c7f30 /sound
parent61fb63c096a2e88b87742eaecfe88912b89f57cf (diff)
[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>
Diffstat (limited to 'sound')
-rw-r--r--sound/core/Kconfig4
-rw-r--r--sound/core/oss/pcm_oss.c6
-rw-r--r--sound/core/pcm.c6
-rw-r--r--sound/core/pcm_memory.c8
4 files changed, 13 insertions, 11 deletions
diff --git a/sound/core/Kconfig b/sound/core/Kconfig
index f3a07fb2e690..4262a1c87731 100644
--- a/sound/core/Kconfig
+++ b/sound/core/Kconfig
@@ -142,7 +142,7 @@ config SND_SUPPORT_OLD_API
142 142
143config SND_VERBOSE_PROCFS 143config SND_VERBOSE_PROCFS
144 bool "Verbose procfs contents" 144 bool "Verbose procfs contents"
145 depends on SND 145 depends on SND && PROC_FS
146 default y 146 default y
147 help 147 help
148 Say Y here to include code for verbose procfs contents (provides 148 Say Y here to include code for verbose procfs contents (provides
@@ -175,7 +175,7 @@ config SND_DEBUG_DETECT
175config SND_PCM_XRUN_DEBUG 175config SND_PCM_XRUN_DEBUG
176 bool "Enable PCM ring buffer overrun/underrun debugging" 176 bool "Enable PCM ring buffer overrun/underrun debugging"
177 default n 177 default n
178 depends on SND_DEBUG 178 depends on SND_DEBUG && SND_VERBOSE_PROCFS
179 help 179 help
180 Say Y to enable the PCM ring buffer overrun/underrun debugging. 180 Say Y to enable the PCM ring buffer overrun/underrun debugging.
181 It is usually not required, but if you have trouble with 181 It is usually not required, but if you have trouble with
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index a7567b891791..ac990bf0b48f 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -2214,7 +2214,7 @@ static int snd_pcm_oss_mmap(struct file *file, struct vm_area_struct *area)
2214 return 0; 2214 return 0;
2215} 2215}
2216 2216
2217#ifdef CONFIG_PROC_FS 2217#ifdef CONFIG_SND_VERBOSE_PROCFS
2218/* 2218/*
2219 * /proc interface 2219 * /proc interface
2220 */ 2220 */
@@ -2368,10 +2368,10 @@ static void snd_pcm_oss_proc_done(struct snd_pcm *pcm)
2368 } 2368 }
2369 } 2369 }
2370} 2370}
2371#else /* !CONFIG_PROC_FS */ 2371#else /* !CONFIG_SND_VERBOSE_PROCFS */
2372#define snd_pcm_oss_proc_init(pcm) 2372#define snd_pcm_oss_proc_init(pcm)
2373#define snd_pcm_oss_proc_done(pcm) 2373#define snd_pcm_oss_proc_done(pcm)
2374#endif /* CONFIG_PROC_FS */ 2374#endif /* CONFIG_SND_VERBOSE_PROCFS */
2375 2375
2376/* 2376/*
2377 * ENTRY functions 2377 * ENTRY functions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 48007a54c8b7..84b00038236d 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -142,7 +142,7 @@ static int snd_pcm_control_ioctl(struct snd_card *card,
142 return -ENOIOCTLCMD; 142 return -ENOIOCTLCMD;
143} 143}
144 144
145#if defined(CONFIG_PROC_FS) && defined(CONFIG_SND_VERBOSE_PROCFS) 145#ifdef CONFIG_SND_VERBOSE_PROCFS
146 146
147#define STATE(v) [SNDRV_PCM_STATE_##v] = #v 147#define STATE(v) [SNDRV_PCM_STATE_##v] = #v
148#define STREAM(v) [SNDRV_PCM_STREAM_##v] = #v 148#define STREAM(v) [SNDRV_PCM_STREAM_##v] = #v
@@ -599,12 +599,12 @@ static int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream)
599 } 599 }
600 return 0; 600 return 0;
601} 601}
602#else /* !CONFIG_PROC_FS */ 602#else /* !CONFIG_SND_VERBOSE_PROCFS */
603static inline int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr) { return 0; } 603static inline int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr) { return 0; }
604static inline int snd_pcm_stream_proc_done(struct snd_pcm_str *pstr) { return 0; } 604static inline int snd_pcm_stream_proc_done(struct snd_pcm_str *pstr) { return 0; }
605static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; } 605static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; }
606static inline int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) { return 0; } 606static inline int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) { return 0; }
607#endif /* CONFIG_PROC_FS */ 607#endif /* CONFIG_SND_VERBOSE_PROCFS */
608 608
609/** 609/**
610 * snd_pcm_new_stream - create a new PCM stream 610 * snd_pcm_new_stream - create a new PCM stream
diff --git a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c
index a0119ae67dcd..428f8c169ee1 100644
--- a/sound/core/pcm_memory.c
+++ b/sound/core/pcm_memory.c
@@ -100,8 +100,10 @@ static void snd_pcm_lib_preallocate_dma_free(struct snd_pcm_substream *substream
100int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream) 100int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream)
101{ 101{
102 snd_pcm_lib_preallocate_dma_free(substream); 102 snd_pcm_lib_preallocate_dma_free(substream);
103#ifdef CONFIG_SND_VERBOSE_PROCFS
103 snd_info_unregister(substream->proc_prealloc_entry); 104 snd_info_unregister(substream->proc_prealloc_entry);
104 substream->proc_prealloc_entry = NULL; 105 substream->proc_prealloc_entry = NULL;
106#endif
105 return 0; 107 return 0;
106} 108}
107 109
@@ -124,7 +126,7 @@ int snd_pcm_lib_preallocate_free_for_all(struct snd_pcm *pcm)
124 return 0; 126 return 0;
125} 127}
126 128
127#ifdef CONFIG_PROC_FS 129#ifdef CONFIG_SND_VERBOSE_PROCFS
128/* 130/*
129 * read callback for prealloc proc file 131 * read callback for prealloc proc file
130 * 132 *
@@ -203,9 +205,9 @@ static inline void preallocate_info_init(struct snd_pcm_substream *substream)
203 substream->proc_prealloc_entry = entry; 205 substream->proc_prealloc_entry = entry;
204} 206}
205 207
206#else /* !CONFIG_PROC_FS */ 208#else /* !CONFIG_SND_VERBOSE_PROCFS */
207#define preallocate_info_init(s) 209#define preallocate_info_init(s)
208#endif 210#endif /* CONFIG_SND_VERBOSE_PROCFS */
209 211
210/* 212/*
211 * pre-allocate the buffer and create a proc file for the substream 213 * pre-allocate the buffer and create a proc file for the substream