[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1c9ec8e6-136f-4b69-a1ec-b1c24d85d80a@wanadoo.fr>
Date: Wed, 20 Dec 2023 19:42:04 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: yang.guang5@....com.cn, lgirdwood@...il.com
Cc: jiang.xuexin@....com.cn, chen.haonan2@....com.cn, cgel.zte@...il.com,
broonie@...nel.org, perex@...ex.cz, tiwai@...e.com,
linux-sound@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH linux-next] ASoC: soc-topology: Switch to use
dev_err_probe() helper
Le 20/12/2023 à 03:57, yang.guang5@....com.cn a écrit :
> From: Yang Guang <yang.guang5@....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@....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
Powered by blists - more mailing lists