• Chen-Yu Tsai's avatar
    ASoC: sun4i-codec: return error code instead of NULL when create_card fails · 85915b63
    Chen-Yu Tsai authored
    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: 45fb6b6f ("ASoC: sunxi: add support for the on-chip codec on
    		      early Allwinner SoCs")
    Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    85915b63
sun4i-codec.c 26.1 KB