Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Matthias Reichl <hias@horus.com>, Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] ASoC: pcm512x: Fix unbalanced regulator enable call in probe error path
Date: Thu, 20 Feb 2020 14:54:58 -0600	[thread overview]
Message-ID: <81a4e657-038a-d664-1b0a-d04e25a7ddfb@linux.intel.com> (raw)
In-Reply-To: <20200220202956.29233-1-hias@horus.com>



On 2/20/20 2:29 PM, Matthias Reichl wrote:
> When we get a clock error during probe we have to call
> regulator_bulk_disable before bailing out, otherwise we trigger
> a warning in regulator_put.
> 
> Fix this by using "goto err" like in the error cases above.
> 
> Fixes: 5a3af1293194d ("ASoC: pcm512x: Add PCM512x driver")
> Signed-off-by: Matthias Reichl <hias@horus.com>

LGTM:

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

> ---
>   sound/soc/codecs/pcm512x.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c
> index 861210f6bf4fd..4cbef9affffda 100644
> --- a/sound/soc/codecs/pcm512x.c
> +++ b/sound/soc/codecs/pcm512x.c
> @@ -1564,13 +1564,15 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap)
>   	}
>   
>   	pcm512x->sclk = devm_clk_get(dev, NULL);
> -	if (PTR_ERR(pcm512x->sclk) == -EPROBE_DEFER)
> -		return -EPROBE_DEFER;
> +	if (PTR_ERR(pcm512x->sclk) == -EPROBE_DEFER) {
> +		ret = -EPROBE_DEFER;
> +		goto err;
> +	}
>   	if (!IS_ERR(pcm512x->sclk)) {
>   		ret = clk_prepare_enable(pcm512x->sclk);
>   		if (ret != 0) {
>   			dev_err(dev, "Failed to enable SCLK: %d\n", ret);
> -			return ret;
> +			goto err;
>   		}
>   	}
>   
> 

  reply	other threads:[~2020-02-20 20:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-20 20:29 [PATCH] ASoC: pcm512x: Fix unbalanced regulator enable call in probe error path Matthias Reichl
2020-02-20 20:54 ` Pierre-Louis Bossart [this message]
2020-02-20 22:18 ` Applied "ASoC: pcm512x: Fix unbalanced regulator enable call in probe error path" to the asoc tree 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=81a4e657-038a-d664-1b0a-d04e25a7ddfb@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=hias@horus.com \
    /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