]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[ALSA] Fix Oops at rmmod with CONFIG_SND_VERBOSE_PROCFS=n
authorTakashi Iwai <tiwai@suse.de>
Tue, 25 Apr 2006 10:56:04 +0000 (12:56 +0200)
committerJaroslav Kysela <perex@suse.cz>
Thu, 27 Apr 2006 19:10:42 +0000 (21:10 +0200)
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>
include/sound/pcm.h
include/sound/pcm_oss.h
sound/core/Kconfig
sound/core/oss/pcm_oss.c
sound/core/pcm.c
sound/core/pcm_memory.c

index df70e7592ab5dace9547942beadb73a08b75887a..373425895faa30bd27db93d8d24e40209bcd4ed4 100644 (file)
@@ -374,12 +374,14 @@ struct snd_pcm_substream {
        /* -- OSS things -- */
        struct snd_pcm_oss_substream oss;
 #endif
+#ifdef CONFIG_SND_VERBOSE_PROCFS
        struct snd_info_entry *proc_root;
        struct snd_info_entry *proc_info_entry;
        struct snd_info_entry *proc_hw_params_entry;
        struct snd_info_entry *proc_sw_params_entry;
        struct snd_info_entry *proc_status_entry;
        struct snd_info_entry *proc_prealloc_entry;
+#endif
        /* misc flags */
        unsigned int no_mmap_ctrl: 1;
        unsigned int hw_opened: 1;
@@ -400,12 +402,14 @@ struct snd_pcm_str {
        struct snd_pcm_oss_stream oss;
 #endif
        struct snd_pcm_file *files;
+#ifdef CONFIG_SND_VERBOSE_PROCFS
        struct snd_info_entry *proc_root;
        struct snd_info_entry *proc_info_entry;
-#ifdef CONFIG_SND_DEBUG
+#ifdef CONFIG_SND_PCM_XRUN_DEBUG
        unsigned int xrun_debug;        /* 0 = disabled, 1 = verbose, 2 = stacktrace */
        struct snd_info_entry *proc_xrun_debug_entry;
 #endif
+#endif
 };
 
 struct snd_pcm {
index 39df2baca18a7df25106e7fa0e9b214120b55d9c..c854647b6f3c9e416db5d4d21872e5f73d5085b0 100644 (file)
@@ -75,7 +75,9 @@ struct snd_pcm_oss_substream {
 struct snd_pcm_oss_stream {
        struct snd_pcm_oss_setup *setup_list;   /* setup list */
        struct mutex setup_mutex;
+#ifdef CONFIG_SND_VERBOSE_PROCFS
        struct snd_info_entry *proc_entry;
+#endif
 };
 
 struct snd_pcm_oss {
index f3a07fb2e690a88c8ace59552c1699f940b41c4f..4262a1c8773191f072b48277a5f42eb2b5d19cb7 100644 (file)
@@ -142,7 +142,7 @@ config SND_SUPPORT_OLD_API
 
 config SND_VERBOSE_PROCFS
        bool "Verbose procfs contents"
-       depends on SND
+       depends on SND && PROC_FS
        default y
        help
          Say Y here to include code for verbose procfs contents (provides
@@ -175,7 +175,7 @@ config SND_DEBUG_DETECT
 config SND_PCM_XRUN_DEBUG
        bool "Enable PCM ring buffer overrun/underrun debugging"
        default n
-       depends on SND_DEBUG
+       depends on SND_DEBUG && SND_VERBOSE_PROCFS
        help
          Say Y to enable the PCM ring buffer overrun/underrun debugging.
          It is usually not required, but if you have trouble with
index a7567b891791e761b7e7ee7d81374e01551360ad..ac990bf0b48f7ab11f5684d56b25fae795bd4d5e 100644 (file)
@@ -2214,7 +2214,7 @@ static int snd_pcm_oss_mmap(struct file *file, struct vm_area_struct *area)
        return 0;
 }
 
-#ifdef CONFIG_PROC_FS
+#ifdef CONFIG_SND_VERBOSE_PROCFS
 /*
  *  /proc interface
  */
@@ -2368,10 +2368,10 @@ static void snd_pcm_oss_proc_done(struct snd_pcm *pcm)
                }
        }
 }
-#else /* !CONFIG_PROC_FS */
+#else /* !CONFIG_SND_VERBOSE_PROCFS */
 #define snd_pcm_oss_proc_init(pcm)
 #define snd_pcm_oss_proc_done(pcm)
-#endif /* CONFIG_PROC_FS */
+#endif /* CONFIG_SND_VERBOSE_PROCFS */
 
 /*
  *  ENTRY functions
index 48007a54c8b7b9e071877ca27757141c914b46cf..84b00038236d49504e9a73b34234d964f2dc73fa 100644 (file)
@@ -142,7 +142,7 @@ static int snd_pcm_control_ioctl(struct snd_card *card,
        return -ENOIOCTLCMD;
 }
 
-#if defined(CONFIG_PROC_FS) && defined(CONFIG_SND_VERBOSE_PROCFS)
+#ifdef CONFIG_SND_VERBOSE_PROCFS
 
 #define STATE(v) [SNDRV_PCM_STATE_##v] = #v
 #define STREAM(v) [SNDRV_PCM_STREAM_##v] = #v
@@ -599,12 +599,12 @@ static int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream)
        }
        return 0;
 }
-#else /* !CONFIG_PROC_FS */
+#else /* !CONFIG_SND_VERBOSE_PROCFS */
 static inline int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr) { return 0; }
 static inline int snd_pcm_stream_proc_done(struct snd_pcm_str *pstr) { return 0; }
 static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; }
 static inline int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) { return 0; }
-#endif /* CONFIG_PROC_FS */
+#endif /* CONFIG_SND_VERBOSE_PROCFS */
 
 /**
  * snd_pcm_new_stream - create a new PCM stream
index a0119ae67dcd709fd870b986cb21ac4be2874ed6..428f8c169ee15406a7ad6c3d2bd8b90cba5b75f6 100644 (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