]> 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)
commit304292fcde9bfdcb82791dec510918f7be2171bc
treef8c715b6380717ae4a7abda0ca4ed852650802ca
parenta245803230f587f66ceddc152f3504b2a960aac2
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: e7303c970569 ("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