MLK-21623: ASoC: ak4458: add return value for ak4458_probe
authorViorel Suman <viorel.suman@nxp.com>
Thu, 9 May 2019 09:37:43 +0000 (12:37 +0300)
committerViorel Suman <viorel.suman@nxp.com>
Thu, 9 May 2019 09:41:29 +0000 (12:41 +0300)
There is ak4458 audio card even no audio board connected, which
is caused by there is no error return value even the i2c access
failed.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
sound/soc/codecs/ak4458.c

index a8ad8ec..3736a12 100644 (file)
@@ -562,9 +562,10 @@ static void ak4458_power_on(struct ak4458_priv *ak4458)
        }
 }
 
-static void ak4458_init(struct snd_soc_component *component)
+static int ak4458_init(struct snd_soc_component *component)
 {
        struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component);
+       int ret;
 
        /* External Mute ON */
        if (ak4458->mute_gpiod)
@@ -572,21 +573,25 @@ static void ak4458_init(struct snd_soc_component *component)
 
        ak4458_power_on(ak4458);
 
-       snd_soc_component_update_bits(component, AK4458_00_CONTROL1,
-                           0x80, 0x80);   /* ACKS bit = 1; 10000000 */
+       /* ACKS bit = 1; 10000000 */
+       ret = snd_soc_component_update_bits(component, AK4458_00_CONTROL1,
+                                           0x80, 0x80);
+       if (ret < 0)
+               return ret;
 
-       ak4458_rstn_control(component, 1);
+       return ak4458_rstn_control(component, 1);
 }
 
 static int ak4458_probe(struct snd_soc_component *component)
 {
        struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component);
+       int ret;
 
-       ak4458_init(component);
+       ret = ak4458_init(component);
 
        ak4458->fs = 48000;
 
-       return 0;
+       return ret;
 }
 
 static void ak4458_remove(struct snd_soc_component *component)