All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: liujing <liujing@cmss.chinamobile.com>
Cc: <david.rhodes@cirrus.com>, <rf@opensource.cirrus.com>,
	<lgirdwood@gmail.com>, <broonie@kernel.org>, <perex@perex.cz>,
	<tiwai@suse.com>, <linux-sound@vger.kernel.org>,
	<patches@opensource.cirrus.com>, <linux-kernel@vger.kernel.org>,
	<vkarpovi@opensource.cirrus.com>
Subject: Re: [PATCH] ASoC: cs35l45:Increase the error checking returned by the function.
Date: Wed, 13 Nov 2024 13:10:31 +0000	[thread overview]
Message-ID: <ZzSlR1rXuNzb9axM@opensource.cirrus.com> (raw)
In-Reply-To: <20241113085756.2636-1-liujing@cmss.chinamobile.com>

On Wed, Nov 13, 2024 at 04:57:56PM +0800, liujing wrote:
> In cs35l45_dsp_init(), it is necessary to check
> the return value of the wm_halo_init function.
> 
> Signed-off-by: liujing <liujing@cmss.chinamobile.com>
> 
> diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c
> index fa1d9d9151f9..c045c7c05947 100644
> --- a/sound/soc/codecs/cs35l45.c
> +++ b/sound/soc/codecs/cs35l45.c
> @@ -1365,7 +1365,10 @@ static int cs35l45_dsp_init(struct cs35l45_private *cs35l45)
>  	dsp->cs_dsp.lock_regions = 0xFFFFFFFF;
>  
>  	ret = wm_halo_init(dsp);
> -
> +	if (ret) {
> +		dev_err(cs35l45->dev, "wm_halo_init failed: %d\n", ret);
> +		return ret;
> +	}

Blank line should go here.

>  	regmap_multi_reg_write(cs35l45->regmap, cs35l45_fs_errata_patch,
>  						   ARRAY_SIZE(cs35l45_fs_errata_patch));
>  

The function is kinda weird, but the error check isn't per say
missing, in that there is a "return ret;" below the
regmap_multi_reg_write. If we are updating this it would make
sense to change that return into a "return 0;". But I would be
slightly nervous that the intention was to apply this errata
patch even on the error path, no clues in the commit messages.
David/Vlad you guys know what the intention was here?

Thanks,
Charles

      reply	other threads:[~2024-11-13 13:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-13  8:57 [PATCH] ASoC: cs35l45:Increase the error checking returned by the function liujing
2024-11-13 13:10 ` Charles Keepax [this message]

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=ZzSlR1rXuNzb9axM@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=broonie@kernel.org \
    --cc=david.rhodes@cirrus.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=liujing@cmss.chinamobile.com \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=rf@opensource.cirrus.com \
    --cc=tiwai@suse.com \
    --cc=vkarpovi@opensource.cirrus.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 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.