Jelajahi Sumber

Merge "asoc: wcd: add NULL pointer check for wcd component"

qctecmdr 2 tahun lalu
induk
melakukan
8a3a2be86e
2 mengubah file dengan 4 tambahan dan 2 penghapusan
  1. 2 1
      asoc/codecs/wcd938x/wcd938x.c
  2. 2 1
      asoc/codecs/wcd939x/wcd939x.c

+ 2 - 1
asoc/codecs/wcd938x/wcd938x.c

@@ -4681,8 +4681,9 @@ static int wcd938x_suspend(struct device *dev)
 		clear_bit(ALLOW_BUCK_DISABLE, &wcd938x->status_mask);
 	}
 	if (wcd938x->dapm_bias_off ||
+		(wcd938x->component &&
 		(snd_soc_component_get_bias_level(wcd938x->component) ==
-		 SND_SOC_BIAS_OFF)) {
+			SND_SOC_BIAS_OFF))) {
 		msm_cdc_set_supplies_lpm_mode(wcd938x->dev,
 					      wcd938x->supplies,
 					      pdata->regulator,

+ 2 - 1
asoc/codecs/wcd939x/wcd939x.c

@@ -4483,8 +4483,9 @@ static int wcd939x_suspend(struct device *dev)
 		clear_bit(ALLOW_BUCK_DISABLE, &wcd939x->status_mask);
 	}
 	if (wcd939x->dapm_bias_off ||
+		(wcd939x->component &&
 		(snd_soc_component_get_bias_level(wcd939x->component) ==
-		SND_SOC_BIAS_OFF)) {
+			SND_SOC_BIAS_OFF))) {
 		msm_cdc_set_supplies_lpm_mode(wcd939x->dev,
 					      wcd939x->supplies,
 					      pdata->regulator,