linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lars@metafoo.de (Lars-Peter Clausen)
To: linux-arm-kernel@lists.infradead.org
Subject: [alsa-devel] [PATCH 1/7] ASoC: fix debugfs directory creation bug
Date: Fri, 27 Jun 2014 04:45:11 +0200	[thread overview]
Message-ID: <53ACDAB7.5080703@metafoo.de> (raw)
In-Reply-To: <E1X0AZe-0003i7-0z@rmk-PC.arm.linux.org.uk>

On 06/26/2014 04:22 PM, Russell King wrote:
> Avoid creating duplicate directories by prefixing codecs and platforms
> with their separate identifiers.  This avoids snd-soc-dummy (which can
> appear both as a dummy platform and a dummy codec on the same card)
> from clashing.

Do we actually want to create debugfs entries for the snd-soc-dummies? There 
shouldn't be any meaningful information in there.

If we want to and if we change the naming scheme of the debugfs entries 
anyway we should also add the component name to the entry name. This fixes a 
issue with devices that register multiple components.

The other thing is that we are working on generalizing the ASoC code and 
getting rid of the distinction between CODECs and platforms. Which means 
there won't really a way to get the prefix anymore soon.

- Lars

>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
>   sound/soc/soc-core.c | 28 ++++++++++++++++++++++++----
>   1 file changed, 24 insertions(+), 4 deletions(-)
>
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index b87d7d882e6d..91120b8e283e 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -270,12 +270,32 @@ static const struct file_operations codec_reg_fops = {
>   	.llseek = default_llseek,
>   };
>
> +static struct dentry *soc_debugfs_create_dir(struct dentry *parent,
> +	const char *fmt, ...)
> +{
> +	struct dentry *de;
> +	va_list ap;
> +	char *s;
> +
> +	va_start(ap, fmt);
> +	s = kvasprintf(GFP_KERNEL, fmt, ap);
> +	va_end(ap);
> +
> +	if (!s)
> +		return NULL;
> +
> +	de = debugfs_create_dir(s, parent);
> +	kfree(s);
> +
> +	return de;
> +}
> +
>   static void soc_init_codec_debugfs(struct snd_soc_codec *codec)
>   {
>   	struct dentry *debugfs_card_root = codec->card->debugfs_card_root;
>
> -	codec->debugfs_codec_root = debugfs_create_dir(codec->name,
> -						       debugfs_card_root);
> +	codec->debugfs_codec_root = soc_debugfs_create_dir(debugfs_card_root,
> +						"codec:%s", codec->name);
>   	if (!codec->debugfs_codec_root) {
>   		dev_warn(codec->dev,
>   			"ASoC: Failed to create codec debugfs directory\n");
> @@ -306,8 +326,8 @@ static void soc_init_platform_debugfs(struct snd_soc_platform *platform)
>   {
>   	struct dentry *debugfs_card_root = platform->card->debugfs_card_root;
>
> -	platform->debugfs_platform_root = debugfs_create_dir(platform->name,
> -						       debugfs_card_root);
> +	platform->debugfs_platform_root = soc_debugfs_create_dir(debugfs_card_root,
> +						"platform:%s", platform->name);
>   	if (!platform->debugfs_platform_root) {
>   		dev_warn(platform->dev,
>   			"ASoC: Failed to create platform debugfs directory\n");
>

  reply	other threads:[~2014-06-27  2:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 14:22 [PATCH 0/7] Kirkwood ASoC updates Russell King - ARM Linux
2014-06-26 14:22 ` [PATCH 1/7] ASoC: fix debugfs directory creation bug Russell King
2014-06-27  2:45   ` Lars-Peter Clausen [this message]
2014-06-28 12:46     ` [alsa-devel] " Mark Brown
2014-06-26 14:22 ` [PATCH 2/7] ASoC: kirkwood-i2s: provide helper KIRKWOOD_RECCTL_ENABLE_MASK definition Russell King
2014-06-26 14:23 ` [PATCH 3/7] ASoC: kirkwood-i2s: fix RECCTL masking Russell King
2014-06-26 14:23 ` [PATCH 4/7] ASoC: kirkwood-i2s: fix mute handling Russell King
2014-06-26 14:23 ` [PATCH 5/7] ASoC: kirkwood-i2s: fix pause handling some more Russell King
2014-06-26 14:23 ` [PATCH 6/7] ASoC: kirkwood: allow smaller audio periods and smaller number of periods Russell King
2014-06-26 14:23 ` [PATCH 7/7] ASoC: kirkwood: implement NO_PERIOD_WAKEUP support Russell King
2014-06-26 18:10 ` [PATCH 0/7] Kirkwood ASoC updates Andrew Lunn
2014-06-26 18:22   ` Russell King - ARM Linux
2014-06-28 12:47 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53ACDAB7.5080703@metafoo.de \
    --to=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).