* [PATCH linux-next] ASoC: soc-topology: Switch to use dev_err_probe() helper
@ 2023-12-20 2:57 yang.guang5
2023-12-20 13:31 ` Mark Brown
2023-12-20 18:42 ` Christophe JAILLET
0 siblings, 2 replies; 3+ messages in thread
From: yang.guang5 @ 2023-12-20 2:57 UTC (permalink / raw)
To: lgirdwood
Cc: jiang.xuexin, chen.haonan2, cgel.zte, broonie, perex, tiwai,
linux-sound, linux-kernel
From: Yang Guang <yang.guang5@zte.com.cn>
dev_err() can be replace with dev_err_probe() which will
check if error code is -EPROBE_DEFER.
Signed-off-by: Chen Haonan <chen.haonan2@zte.com.cn>
---
sound/soc/soc-topology.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index ba4890991f0d..c0d40162aff2 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -1736,8 +1736,7 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
ret = snd_soc_add_pcm_runtimes(tplg->comp->card, link, 1);
if (ret < 0) {
- if (ret != -EPROBE_DEFER)
- dev_err(tplg->dev, "ASoC: adding FE link failed\n");
+ dev_err_probe(tplg->dev, ret, "ASoC: adding FE link failed\n");
goto err;
}
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH linux-next] ASoC: soc-topology: Switch to use dev_err_probe() helper
2023-12-20 2:57 [PATCH linux-next] ASoC: soc-topology: Switch to use dev_err_probe() helper yang.guang5
@ 2023-12-20 13:31 ` Mark Brown
2023-12-20 18:42 ` Christophe JAILLET
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2023-12-20 13:31 UTC (permalink / raw)
To: yang.guang5
Cc: lgirdwood, jiang.xuexin, chen.haonan2, cgel.zte, perex, tiwai,
linux-sound, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 292 bytes --]
On Wed, Dec 20, 2023 at 10:57:08AM +0800, yang.guang5@zte.com.cn wrote:
> From: Yang Guang <yang.guang5@zte.com.cn>
>
> dev_err() can be replace with dev_err_probe() which will
> check if error code is -EPROBE_DEFER.
This doesn't apply against current code, please check and resend.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH linux-next] ASoC: soc-topology: Switch to use dev_err_probe() helper
2023-12-20 2:57 [PATCH linux-next] ASoC: soc-topology: Switch to use dev_err_probe() helper yang.guang5
2023-12-20 13:31 ` Mark Brown
@ 2023-12-20 18:42 ` Christophe JAILLET
1 sibling, 0 replies; 3+ messages in thread
From: Christophe JAILLET @ 2023-12-20 18:42 UTC (permalink / raw)
To: yang.guang5, lgirdwood
Cc: jiang.xuexin, chen.haonan2, cgel.zte, broonie, perex, tiwai,
linux-sound, linux-kernel
Le 20/12/2023 à 03:57, yang.guang5@zte.com.cn a écrit :
> From: Yang Guang <yang.guang5@zte.com.cn>
>
> dev_err() can be replace with dev_err_probe() which will
> check if error code is -EPROBE_DEFER.
>
> Signed-off-by: Chen Haonan <chen.haonan2@zte.com.cn>
> ---
> sound/soc/soc-topology.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
> index ba4890991f0d..c0d40162aff2 100644
> --- a/sound/soc/soc-topology.c
> +++ b/sound/soc/soc-topology.c
> @@ -1736,8 +1736,7 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
>
> ret = snd_soc_add_pcm_runtimes(tplg->comp->card, link, 1);
> if (ret < 0) {
> - if (ret != -EPROBE_DEFER)
> - dev_err(tplg->dev, "ASoC: adding FE link failed\n");
> + dev_err_probe(tplg->dev, ret, "ASoC: adding FE link failed\n");
> goto err;
> }
>
Hi,
apparently, err: is
err:
return ret;
}
So, you could probably, directly use return dev_err_probe(...); and also
save some { }.
CJ
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-12-20 18:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-20 2:57 [PATCH linux-next] ASoC: soc-topology: Switch to use dev_err_probe() helper yang.guang5
2023-12-20 13:31 ` Mark Brown
2023-12-20 18:42 ` Christophe JAILLET
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome