]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commit
ASoC: sun4i-codec: return error code instead of NULL when create_card fails
authorChen-Yu Tsai <wens@csie.org>
Mon, 31 Oct 2016 06:42:09 +0000 (14:42 +0800)
committerIshan Mittal <imittal@nvidia.com>
Fri, 6 Jan 2017 10:18:01 +0000 (15:48 +0530)
commit13a23083b67d5c79420054102576d8bce481e3ce
treeb104e59eeed7df6487dc4d8e7acf9b54072039b6
parenta4697510b5e98134352ff790ca98c1fd72891483
ASoC: sun4i-codec: return error code instead of NULL when create_card fails

commit 85915b63ad8b796848f431b66c9ba5e356e722e5 upstream.

When sun4i_codec_create_card fails, we do not assign a proper error
code to the return value. The return value would be 0 from the previous
function call, or we would have bailed out sooner. This would confuse
the driver core into thinking the device probe succeeded, when in fact
it didn't, leaving various devres based resources lingering.

Make the create_card function pass back a meaningful error code, and
assign it to the return value.

Fixes: 45fb6b6f2aa3 ("ASoC: sunxi: add support for the on-chip codec on
      early Allwinner SoCs")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/sunxi/sun4i-codec.c