Browse Source

asoc: Return the correct clk_div value

Incorrect check for return value of clk_div_get
causes CLK_DIV2 setting being missed. Fix the
return value check to address this.

Change-Id: Ic1b6761ab836a38c657ac7e43efda0e2f23c5fee
Signed-off-by: Aditya Bavanari <[email protected]>
Aditya Bavanari 3 years ago
parent
commit
a415d7381d
2 changed files with 3 additions and 3 deletions
  1. 2 2
      asoc/codecs/bolero/bolero-cdc.c
  2. 1 1
      asoc/codecs/lpass-cdc/lpass-cdc.c

+ 2 - 2
asoc/codecs/bolero/bolero-cdc.c

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0-only
-/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/of_platform.h>
@@ -509,7 +509,7 @@ static u8 bolero_dmic_clk_div_get(struct snd_soc_component *component,
 
 	if (priv->macro_params[macro].clk_div_get) {
 		ret = priv->macro_params[macro].clk_div_get(component);
-		if (ret > 0)
+		if (ret >= 0)
 			return ret;
 	}
 

+ 1 - 1
asoc/codecs/lpass-cdc/lpass-cdc.c

@@ -472,7 +472,7 @@ static u8 lpass_cdc_dmic_clk_div_get(struct snd_soc_component *component,
 
 	if (priv->macro_params[macro].clk_div_get) {
 		ret = priv->macro_params[macro].clk_div_get(component);
-		if (ret > 0)
+		if (ret >= 0)
 			return ret;
 	}