aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2011-04-30 13:45:48 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-05-03 13:43:32 -0400
commit8eecaf62445e175572ffabaab090b471001c5a2c (patch)
tree00372372fd0eeb721537434a8377e654be462b82 /sound/soc/soc-dapm.c
parent0aaae527c71e6af571093d90474f37c8662008d5 (diff)
ASoC: Move DAPM debugfs directory creation to snd_soc_dapm_debugfs_init
Move the creation of the DAPM debugfs directory to snd_soc_dapm_debugfs_init instead of having the same duplicated code in both codec and card DAPM setup. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 378f08adee56..ffed456b2142 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1254,13 +1254,19 @@ static const struct file_operations dapm_bias_fops = {
1254 .llseek = default_llseek, 1254 .llseek = default_llseek,
1255}; 1255};
1256 1256
1257void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm) 1257void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm,
1258 struct dentry *parent)
1258{ 1259{
1259 struct snd_soc_dapm_widget *w; 1260 struct snd_soc_dapm_widget *w;
1260 struct dentry *d; 1261 struct dentry *d;
1261 1262
1262 if (!dapm->debugfs_dapm) 1263 dapm->debugfs_dapm = debugfs_create_dir("dapm", parent);
1264
1265 if (!dapm->debugfs_dapm) {
1266 printk(KERN_WARNING
1267 "Failed to create DAPM debugfs directory\n");
1263 return; 1268 return;
1269 }
1264 1270
1265 d = debugfs_create_file("bias_level", 0444, 1271 d = debugfs_create_file("bias_level", 0444,
1266 dapm->debugfs_dapm, dapm, 1272 dapm->debugfs_dapm, dapm,
@@ -1283,7 +1289,8 @@ void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm)
1283 } 1289 }
1284} 1290}
1285#else 1291#else
1286void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm) 1292void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm,
1293 struct dentry *parent)
1287{ 1294{
1288} 1295}
1289#endif 1296#endif