[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGb2v67cVXWtM=AzeFcftnajSs=+C6F12P_EvnXHB=oKsAm5Cw@mail.gmail.com>
Date: Wed, 10 Aug 2016 22:04:23 +0800
From: Chen-Yu Tsai <wens@...e.org>
To: Wei Yongjun <weiyj.lk@...il.com>
Cc: Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Maxime Ripard <maxime.ripard@...e-electrons.com>,
Chen-Yu Tsai <wens@...e.org>,
Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
Emilio Lopez <emilio@...pez.com.ar>,
Hans De Goede <hdegoede@...hat.com>, ats@...og.org,
fengguang.wu@...el.com, Linux-ALSA <alsa-devel@...a-project.org>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] ASoC: sun4i-codec: Fix error return code in sun4i_codec_probe()
On Wed, Aug 10, 2016 at 9:42 PM, Wei Yongjun <weiyj.lk@...il.com> wrote:
> Fix to return error code -ENOMEM instead of 0 when create card
> failed, as done elsewhere in this function.
>
> Fixes: 45fb6b6f2aa3 ("ASoC: sunxi: add support for the on-chip
> codec on early Allwinner SoCs")
> Signed-off-by: Wei Yongjun <weiyj.lk@...il.com>
> ---
> sound/soc/sunxi/sun4i-codec.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
> index 0e19c50..e741659 100644
> --- a/sound/soc/sunxi/sun4i-codec.c
> +++ b/sound/soc/sunxi/sun4i-codec.c
> @@ -846,6 +846,7 @@ static int sun4i_codec_probe(struct platform_device *pdev)
> card = sun4i_codec_create_card(&pdev->dev);
> if (!card) {
> dev_err(&pdev->dev, "Failed to create our card\n");
> + ret = -ENOMEM;
> goto err_unregister_codec;
> }
>
This works, though it might be better to fix the create_card function and
any custom functions called in there to pass back a proper error value.
Regards
ChenYu
Powered by blists - more mailing lists