diff options
author | Mark Brown <broonie@linaro.org> | 2014-06-28 08:55:22 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-06-28 09:47:12 -0400 |
commit | 211bcc6c3af90f3ee1f1297349d9d692e5f1c7e0 (patch) | |
tree | 65f0b2a66235d26eb92c54bea0ddaf8006bcb451 /sound/soc/soc-core.c | |
parent | 88a8fe3df65fa0229b04f1c03411062230091cdd (diff) | |
parent | e73f3de5c5eb5285a1b1d8eed111eb229702b20f (diff) |
Merge remote-tracking branch 'asoc/fix/debugfs' into asoc-component
Conflicts:
sound/soc/soc-core.c
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 19c1e9588e05..72d4a2b009fa 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -270,12 +270,33 @@ static const struct file_operations codec_reg_fops = { | |||
270 | .llseek = default_llseek, | 270 | .llseek = default_llseek, |
271 | }; | 271 | }; |
272 | 272 | ||
273 | static struct dentry *soc_debugfs_create_dir(struct dentry *parent, | ||
274 | const char *fmt, ...) | ||
275 | { | ||
276 | struct dentry *de; | ||
277 | va_list ap; | ||
278 | char *s; | ||
279 | |||
280 | va_start(ap, fmt); | ||
281 | s = kvasprintf(GFP_KERNEL, fmt, ap); | ||
282 | va_end(ap); | ||
283 | |||
284 | if (!s) | ||
285 | return NULL; | ||
286 | |||
287 | de = debugfs_create_dir(s, parent); | ||
288 | kfree(s); | ||
289 | |||
290 | return de; | ||
291 | } | ||
292 | |||
273 | static void soc_init_codec_debugfs(struct snd_soc_codec *codec) | 293 | static void soc_init_codec_debugfs(struct snd_soc_codec *codec) |
274 | { | 294 | { |
275 | struct dentry *debugfs_card_root = codec->card->debugfs_card_root; | 295 | struct dentry *debugfs_card_root = codec->card->debugfs_card_root; |
276 | 296 | ||
277 | codec->debugfs_codec_root = debugfs_create_dir(codec->component.name, | 297 | codec->debugfs_codec_root = soc_debugfs_create_dir(debugfs_card_root, |
278 | debugfs_card_root); | 298 | "codec:%s", |
299 | codec->component.name); | ||
279 | if (!codec->debugfs_codec_root) { | 300 | if (!codec->debugfs_codec_root) { |
280 | dev_warn(codec->dev, | 301 | dev_warn(codec->dev, |
281 | "ASoC: Failed to create codec debugfs directory\n"); | 302 | "ASoC: Failed to create codec debugfs directory\n"); |
@@ -306,8 +327,9 @@ static void soc_init_platform_debugfs(struct snd_soc_platform *platform) | |||
306 | { | 327 | { |
307 | struct dentry *debugfs_card_root = platform->card->debugfs_card_root; | 328 | struct dentry *debugfs_card_root = platform->card->debugfs_card_root; |
308 | 329 | ||
309 | platform->debugfs_platform_root = debugfs_create_dir( | 330 | platform->debugfs_platform_root = soc_debugfs_create_dir(debugfs_card_root, |
310 | platform->component.name, debugfs_card_root); | 331 | "platform:%s", |
332 | platform->component.name); | ||
311 | if (!platform->debugfs_platform_root) { | 333 | if (!platform->debugfs_platform_root) { |
312 | dev_warn(platform->dev, | 334 | dev_warn(platform->dev, |
313 | "ASoC: Failed to create platform debugfs directory\n"); | 335 | "ASoC: Failed to create platform debugfs directory\n"); |