From: Krzysztof Kozlowski <krzk@kernel.org>
To: "Yang Ruibin" <11162571@vivo.com>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Nuno Sá" <nuno.sa@analog.com>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
"Jaroslav Kysela" <perex@perex.cz>,
"Takashi Iwai" <tiwai@suse.com>,
alsa-devel@alsa-project.org, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: opensource.kernel@vivo.com
Subject: Re: [PATCH v1] ASoC: codecs: Switch to use dev_err_probe()
Date: Fri, 30 Aug 2024 19:14:12 +0200 [thread overview]
Message-ID: <b1d1f523-6852-4877-be73-85cb6728d9a8@kernel.org> (raw)
In-Reply-To: <20240830014733.3467006-1-11162571@vivo.com>
On 30/08/2024 03:47, Yang Ruibin wrote:
> Using dev_err_probe() instead of dev_err() in probe() simplifies
> the error path and standardizes the format of the error code.
>
> Signed-off-by: Yang Ruibin <11162571@vivo.com>
> ---
> sound/soc/codecs/ad1980.c | 8 +++-----
> sound/soc/codecs/adau1701.c | 19 +++++++------------
> sound/soc/codecs/ssm2602.c | 6 ++----
> 3 files changed, 12 insertions(+), 21 deletions(-)
>
...
> diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c
> index c29324403..153eb55a3 100644
> --- a/sound/soc/codecs/ssm2602.c
> +++ b/sound/soc/codecs/ssm2602.c
> @@ -605,10 +605,8 @@ static int ssm260x_component_probe(struct snd_soc_component *component)
> int ret;
>
> ret = regmap_write(ssm2602->regmap, SSM2602_RESET, 0);
> - if (ret < 0) {
> - dev_err(component->dev, "Failed to issue reset: %d\n", ret);
> - return ret;
> - }
> + if (ret < 0)
> + return dev_err_probe(component->dev, ret, "Failed to issue reset\n");
After quick look, I think this might not be a probe path, thus the code
might not be correct.
Best regards,
Krzysztof
prev parent reply other threads:[~2024-08-30 17:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-30 1:47 [PATCH v1] ASoC: codecs: Switch to use dev_err_probe() Yang Ruibin
2024-08-30 17:14 ` Krzysztof Kozlowski [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=b1d1f523-6852-4877-be73-85cb6728d9a8@kernel.org \
--to=krzk@kernel.org \
--cc=11162571@vivo.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=opensource.kernel@vivo.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.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