ASoC: Improve the debugfs hierarchy
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>
Fri, 2 Oct 2009 06:17:37 +0000 (09:17 +0300)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 2 Oct 2009 10:24:21 +0000 (11:24 +0100)
Change the way the debugfs entries are created:
If the codec->dev is valid, than use:
debugfs/asoc/{codec->name}.{dev_name(codec->dev)}/

if the codec->dev is NULL:
debugfs/asoc/{codec->name}/

as root for the debugfs entries.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/soc-core.c

index e4ab36daf3f7bf5a0d674f5eadf95e53ea5be577..1dec9d21c55ef1829f5b1b8929c7fb31f7e486b6 100644 (file)
@@ -1256,8 +1256,12 @@ static void soc_init_codec_debugfs(struct snd_soc_codec *codec)
 {
        char codec_root[128];
 
-       snprintf(codec_root, sizeof(codec_root),
-                "%s-%s", dev_name(codec->socdev->dev), codec->name);
+       if (codec->dev)
+               snprintf(codec_root, sizeof(codec_root),
+                       "%s.%s", codec->name, dev_name(codec->dev));
+       else
+               snprintf(codec_root, sizeof(codec_root),
+                       "%s", codec->name);
 
        codec->debugfs_codec_root = debugfs_create_dir(codec_root,
                                                       debugfs_root);