ASoC: Export debugfs root dentry
authorStephen Warren <swarren@nvidia.com>
Sat, 8 Jan 2011 05:36:11 +0000 (22:36 -0700)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 10 Jan 2011 22:20:04 +0000 (22:20 +0000)
A couple Tegra ASoC drivers will create debugfs entries. Mark requested
these by under debugfs/asoc/ not just debugfs/. To enable this, export
the dentry representing debugfs/asoc/.

Also, rename debugfs_root -> asoc_debugfs_root now it's exported to
prevent potential symbol name clashes.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
include/sound/soc.h
sound/soc/soc-core.c

index 74921f2..96aadbb 100644 (file)
@@ -756,4 +756,8 @@ static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd)
 
 #include <sound/soc-dai.h>
 
 
 #include <sound/soc-dai.h>
 
+#ifdef CONFIG_DEBUG_FS
+extern struct dentry *asoc_debugfs_root;
+#endif
+
 #endif
 #endif
index 4274435..0484e50 100644 (file)
@@ -48,7 +48,8 @@ static DEFINE_MUTEX(pcm_mutex);
 static DECLARE_WAIT_QUEUE_HEAD(soc_pm_waitq);
 
 #ifdef CONFIG_DEBUG_FS
 static DECLARE_WAIT_QUEUE_HEAD(soc_pm_waitq);
 
 #ifdef CONFIG_DEBUG_FS
-static struct dentry *debugfs_root;
+struct dentry *asoc_debugfs_root;
+EXPORT_SYMBOL_GPL(asoc_debugfs_root);
 #endif
 
 static DEFINE_MUTEX(client_mutex);
 #endif
 
 static DEFINE_MUTEX(client_mutex);
@@ -360,7 +361,7 @@ static const struct file_operations platform_list_fops = {
 static void soc_init_card_debugfs(struct snd_soc_card *card)
 {
        card->debugfs_card_root = debugfs_create_dir(card->name,
 static void soc_init_card_debugfs(struct snd_soc_card *card)
 {
        card->debugfs_card_root = debugfs_create_dir(card->name,
-                                                    debugfs_root);
+                                                    asoc_debugfs_root);
        if (!card->debugfs_card_root) {
                dev_warn(card->dev,
                         "ASoC: Failed to create codec debugfs directory\n");
        if (!card->debugfs_card_root) {
                dev_warn(card->dev,
                         "ASoC: Failed to create codec debugfs directory\n");
@@ -3583,22 +3584,22 @@ EXPORT_SYMBOL_GPL(snd_soc_unregister_codec);
 static int __init snd_soc_init(void)
 {
 #ifdef CONFIG_DEBUG_FS
 static int __init snd_soc_init(void)
 {
 #ifdef CONFIG_DEBUG_FS
-       debugfs_root = debugfs_create_dir("asoc", NULL);
-       if (IS_ERR(debugfs_root) || !debugfs_root) {
+       asoc_debugfs_root = debugfs_create_dir("asoc", NULL);
+       if (IS_ERR(asoc_debugfs_root) || !asoc_debugfs_root) {
                printk(KERN_WARNING
                       "ASoC: Failed to create debugfs directory\n");
                printk(KERN_WARNING
                       "ASoC: Failed to create debugfs directory\n");
-               debugfs_root = NULL;
+               asoc_debugfs_root = NULL;
        }
 
        }
 
-       if (!debugfs_create_file("codecs", 0444, debugfs_root, NULL,
+       if (!debugfs_create_file("codecs", 0444, asoc_debugfs_root, NULL,
                                 &codec_list_fops))
                pr_warn("ASoC: Failed to create CODEC list debugfs file\n");
 
                                 &codec_list_fops))
                pr_warn("ASoC: Failed to create CODEC list debugfs file\n");
 
-       if (!debugfs_create_file("dais", 0444, debugfs_root, NULL,
+       if (!debugfs_create_file("dais", 0444, asoc_debugfs_root, NULL,
                                 &dai_list_fops))
                pr_warn("ASoC: Failed to create DAI list debugfs file\n");
 
                                 &dai_list_fops))
                pr_warn("ASoC: Failed to create DAI list debugfs file\n");
 
-       if (!debugfs_create_file("platforms", 0444, debugfs_root, NULL,
+       if (!debugfs_create_file("platforms", 0444, asoc_debugfs_root, NULL,
                                 &platform_list_fops))
                pr_warn("ASoC: Failed to create platform list debugfs file\n");
 #endif
                                 &platform_list_fops))
                pr_warn("ASoC: Failed to create platform list debugfs file\n");
 #endif
@@ -3610,7 +3611,7 @@ module_init(snd_soc_init);
 static void __exit snd_soc_exit(void)
 {
 #ifdef CONFIG_DEBUG_FS
 static void __exit snd_soc_exit(void)
 {
 #ifdef CONFIG_DEBUG_FS
-       debugfs_remove_recursive(debugfs_root);
+       debugfs_remove_recursive(asoc_debugfs_root);
 #endif
        platform_driver_unregister(&soc_driver);
 }
 #endif
        platform_driver_unregister(&soc_driver);
 }