All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: fsl_ssi: Do not create debugfs directory
@ 2015-04-08 17:21 Fabio Estevam
  2015-04-09  7:49 ` Nicolin Chen
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2015-04-08 17:21 UTC (permalink / raw)
  To: broonie; +Cc: nicoleotsuka, Fabio Estevam, alsa-devel, lars, timur

From: Fabio Estevam <fabio.estevam@freescale.com>

Since commit 81c7cfd1b22a0 ("ASoC: Move debugfs registration to the
component level") ASoC core code deals with registering debugfs, so we
should not be creating the debugfs directory locally in order to avoid
the following warning:

fsl-ssi-dai 2028000.ssi: ASoC: Failed to create component debugfs directory

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- Only remove dir creation/remove as suggested by Mark Brown

 sound/soc/fsl/fsl_ssi.h     |  1 -
 sound/soc/fsl/fsl_ssi_dbg.c | 13 +++----------
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/sound/soc/fsl/fsl_ssi.h b/sound/soc/fsl/fsl_ssi.h
index 5065105..68aef90 100644
--- a/sound/soc/fsl/fsl_ssi.h
+++ b/sound/soc/fsl/fsl_ssi.h
@@ -211,7 +211,6 @@ struct device;
 #if IS_ENABLED(CONFIG_DEBUG_FS)
 
 struct fsl_ssi_dbg {
-	struct dentry *dbg_dir;
 	struct dentry *dbg_stats;
 
 	struct {
diff --git a/sound/soc/fsl/fsl_ssi_dbg.c b/sound/soc/fsl/fsl_ssi_dbg.c
index 5469ffb..46cea84 100644
--- a/sound/soc/fsl/fsl_ssi_dbg.c
+++ b/sound/soc/fsl/fsl_ssi_dbg.c
@@ -142,22 +142,15 @@ static const struct file_operations fsl_ssi_stats_ops = {
 
 int fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg, struct device *dev)
 {
-	ssi_dbg->dbg_dir = debugfs_create_dir(dev_name(dev), NULL);
-	if (!ssi_dbg->dbg_dir)
+	ssi_dbg->dbg_stats = debugfs_create_file("stats", S_IRUGO, NULL,
+						 ssi_dbg, &fsl_ssi_stats_ops);
+	if (!ssi_dbg->dbg_stats)
 		return -ENOMEM;
 
-	ssi_dbg->dbg_stats = debugfs_create_file("stats", S_IRUGO,
-			ssi_dbg->dbg_dir, ssi_dbg, &fsl_ssi_stats_ops);
-	if (!ssi_dbg->dbg_stats) {
-		debugfs_remove(ssi_dbg->dbg_dir);
-		return -ENOMEM;
-	}
-
 	return 0;
 }
 
 void fsl_ssi_debugfs_remove(struct fsl_ssi_dbg *ssi_dbg)
 {
 	debugfs_remove(ssi_dbg->dbg_stats);
-	debugfs_remove(ssi_dbg->dbg_dir);
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] ASoC: fsl_ssi: Do not create debugfs directory
  2015-04-08 17:21 [PATCH v2] ASoC: fsl_ssi: Do not create debugfs directory Fabio Estevam
@ 2015-04-09  7:49 ` Nicolin Chen
  2015-04-09  7:56   ` Lars-Peter Clausen
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolin Chen @ 2015-04-09  7:49 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Fabio Estevam, alsa-devel, broonie, timur, lars

On Wed, Apr 08, 2015 at 02:21:24PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Since commit 81c7cfd1b22a0 ("ASoC: Move debugfs registration to the
> component level") ASoC core code deals with registering debugfs, so we
> should not be creating the debugfs directory locally in order to avoid
> the following warning:
> 
> fsl-ssi-dai 2028000.ssi: ASoC: Failed to create component debugfs directory
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> Changes since v1:
> - Only remove dir creation/remove as suggested by Mark Brown

> diff --git a/sound/soc/fsl/fsl_ssi_dbg.c b/sound/soc/fsl/fsl_ssi_dbg.c
> index 5469ffb..46cea84 100644
> --- a/sound/soc/fsl/fsl_ssi_dbg.c
> +++ b/sound/soc/fsl/fsl_ssi_dbg.c
> @@ -142,22 +142,15 @@ static const struct file_operations fsl_ssi_stats_ops = {
>  
>  int fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg, struct device *dev)
>  {
> -	ssi_dbg->dbg_dir = debugfs_create_dir(dev_name(dev), NULL);
> -	if (!ssi_dbg->dbg_dir)
> +	ssi_dbg->dbg_stats = debugfs_create_file("stats", S_IRUGO, NULL,
> +						 ssi_dbg, &fsl_ssi_stats_ops);
> +	if (!ssi_dbg->dbg_stats)
>  		return -ENOMEM;
>  
> -	ssi_dbg->dbg_stats = debugfs_create_file("stats", S_IRUGO,
> -			ssi_dbg->dbg_dir, ssi_dbg, &fsl_ssi_stats_ops);

It seems that dropping the dbg_dir and using NULL will make the stats
become an orphan inside the debugfs. I am wondering if we can get the
dbg_dir from the component so as to put this stats under the directory
of SSIn as before.

Nicolin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] ASoC: fsl_ssi: Do not create debugfs directory
  2015-04-09  7:49 ` Nicolin Chen
@ 2015-04-09  7:56   ` Lars-Peter Clausen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars-Peter Clausen @ 2015-04-09  7:56 UTC (permalink / raw)
  To: Nicolin Chen, Fabio Estevam; +Cc: Fabio Estevam, alsa-devel, broonie, timur

On 04/09/2015 09:49 AM, Nicolin Chen wrote:
> On Wed, Apr 08, 2015 at 02:21:24PM -0300, Fabio Estevam wrote:
>> From: Fabio Estevam <fabio.estevam@freescale.com>
>>
>> Since commit 81c7cfd1b22a0 ("ASoC: Move debugfs registration to the
>> component level") ASoC core code deals with registering debugfs, so we
>> should not be creating the debugfs directory locally in order to avoid
>> the following warning:
>>
>> fsl-ssi-dai 2028000.ssi: ASoC: Failed to create component debugfs directory
>>
>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>> ---
>> Changes since v1:
>> - Only remove dir creation/remove as suggested by Mark Brown
>
>> diff --git a/sound/soc/fsl/fsl_ssi_dbg.c b/sound/soc/fsl/fsl_ssi_dbg.c
>> index 5469ffb..46cea84 100644
>> --- a/sound/soc/fsl/fsl_ssi_dbg.c
>> +++ b/sound/soc/fsl/fsl_ssi_dbg.c
>> @@ -142,22 +142,15 @@ static const struct file_operations fsl_ssi_stats_ops = {
>>
>>   int fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg, struct device *dev)
>>   {
>> -	ssi_dbg->dbg_dir = debugfs_create_dir(dev_name(dev), NULL);
>> -	if (!ssi_dbg->dbg_dir)
>> +	ssi_dbg->dbg_stats = debugfs_create_file("stats", S_IRUGO, NULL,
>> +						 ssi_dbg, &fsl_ssi_stats_ops);
>> +	if (!ssi_dbg->dbg_stats)
>>   		return -ENOMEM;
>>
>> -	ssi_dbg->dbg_stats = debugfs_create_file("stats", S_IRUGO,
>> -			ssi_dbg->dbg_dir, ssi_dbg, &fsl_ssi_stats_ops);
>
> It seems that dropping the dbg_dir and using NULL will make the stats
> become an orphan inside the debugfs. I am wondering if we can get the
> dbg_dir from the component so as to put this stats under the directory
> of SSIn as before.

That would be the right thing I guess. But the original code registers a 
top-level debugfs directory with the name of the device. Whereas the debugfs 
directory for the component is created in asoc/CARD_NAME/. I don't see how 
these two could collide? I think the patch is trying to fix the wrong thing, 
the issue for the collision is something else.

- Lars

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-09  7:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-08 17:21 [PATCH v2] ASoC: fsl_ssi: Do not create debugfs directory Fabio Estevam
2015-04-09  7:49 ` Nicolin Chen
2015-04-09  7:56   ` Lars-Peter Clausen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.