]> git.baikalelectronics.ru Git - kernel.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)
committerMark Brown <broonie@kernel.org>
Mon, 31 Oct 2016 15:46:16 +0000 (09:46 -0600)
commitcf6d29a4b91d6bc88c0a4c8d3d5541ba69b7d55d
treef8c715b6380717ae4a7abda0ca4ed852650802ca
parent1df7eb1ca477b826c461b694d57789b4da41844a
ASoC: sun4i-codec: return error code instead of NULL when create_card fails

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: 30c38576e284 ("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>
sound/soc/sunxi/sun4i-codec.c