ASoC: ak4458: rstn_control - return a non-zero on error only
authorViorel Suman <viorel.suman@nxp.com>
Mon, 13 May 2019 10:02:42 +0000 (10:02 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 13 May 2019 15:12:59 +0000 (16:12 +0100)
snd_soc_component_update_bits() may return 1 if operation
was successful and the value of the register changed.
Return a non-zero in ak4458_rstn_control for an error only.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/ak4458.c

index 4c5c3ec9260955a091669ce06aa5937881e0c353..71562154c0b1e6e38873cfa76d8ab9e03721767d 100644 (file)
@@ -304,7 +304,10 @@ static int ak4458_rstn_control(struct snd_soc_component *component, int bit)
                                          AK4458_00_CONTROL1,
                                          AK4458_RSTN_MASK,
                                          0x0);
-       return ret;
+       if (ret < 0)
+               return ret;
+
+       return 0;
 }
 
 static int ak4458_hw_params(struct snd_pcm_substream *substream,