All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	alsa-devel@alsa-project.org, stable@vger.kernel.org
Subject: Re: [PATCH 2/2] ASoC: dapm: Adapt for debugfs API change
Date: Fri, 21 Jun 2019 15:22:22 +0200	[thread overview]
Message-ID: <20190621132222.GB10459@kroah.com> (raw)
In-Reply-To: <20190621113357.8264-2-broonie@kernel.org>

On Fri, Jun 21, 2019 at 12:33:57PM +0100, Mark Brown wrote:
> Back in ff9fb72bc07705c (debugfs: return error values, not NULL) the
> debugfs APIs were changed to return error pointers rather than NULL
> pointers on error, breaking the error checking in ASoC. Update the
> code to use IS_ERR() and log the codes that are returned as part of
> the error messages.
> 
> Fixes: ff9fb72bc07705c (debugfs: return error values, not NULL)
> Signed-off-by: Mark Brown <broonie@kernel.org>
> Cc: stable@vger.kernel.org
> ---
>  sound/soc/soc-dapm.c | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
> index 6b44b4a78b8e..f013b24c050a 100644
> --- a/sound/soc/soc-dapm.c
> +++ b/sound/soc/soc-dapm.c
> @@ -2156,23 +2156,25 @@ void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm,
>  {
>  	struct dentry *d;
>  
> -	if (!parent)
> +	if (!parent || IS_ERR(parent))
>  		return;

How can parent be NULL?

>  
>  	dapm->debugfs_dapm = debugfs_create_dir("dapm", parent);
>  
> -	if (!dapm->debugfs_dapm) {
> +	if (IS_ERR(dapm->debugfs_dapm)) {
>  		dev_warn(dapm->dev,
> -		       "ASoC: Failed to create DAPM debugfs directory\n");
> +			 "ASoC: Failed to create DAPM debugfs directory %ld\n",
> +			 PTR_ERR(dapm->debugfs_dapm));

Same comment as before, no need to print anything.

>  		return;
>  	}
>  
>  	d = debugfs_create_file("bias_level", 0444,
>  				dapm->debugfs_dapm, dapm,
>  				&dapm_bias_fops);
> -	if (!d)
> +	if (IS_ERR(d))
>  		dev_warn(dapm->dev,
> -			 "ASoC: Failed to create bias level debugfs file\n");
> +			 "ASoC: Failed to create bias level debugfs file: %ld\n",
> +			 PTR_ERR(d));

Again, no need to warn, no one will see it :)

I am trying to make it so that debugfs doesn't return anything for when
a file is created.  Now if that will ever be possible or not, I don't
know, but I am pretty close in one of the branches in my driver-core
tree...

thanks,

greg k-h

  reply	other threads:[~2019-06-21 13:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-21 11:33 [PATCH 1/2] ASoC: core: Adapt for debugfs API change Mark Brown
2019-06-21 11:33 ` [PATCH 2/2] ASoC: dapm: " Mark Brown
2019-06-21 13:22   ` Greg KH [this message]
2019-06-21 14:30     ` Mark Brown
2019-06-21 14:53       ` Greg KH
2019-06-21 15:20         ` Mark Brown
2019-06-24 16:32   ` Applied "ASoC: dapm: Adapt for debugfs API change" to the asoc tree Mark Brown
2019-06-24 16:32     ` Mark Brown
2019-06-21 13:20 ` [PATCH 1/2] ASoC: core: Adapt for debugfs API change Greg KH
2019-06-24 16:32 ` Applied "ASoC: core: Adapt for debugfs API change" to the asoc tree Mark Brown
2019-06-24 16:32   ` 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=20190621132222.GB10459@kroah.com \
    --to=greg@kroah.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=stable@vger.kernel.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 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.