Prechádzať zdrojové kódy

asoc: codec: add error handle for swr_dmic port params

handle errors if "qcom,swr-tx-port-params" is not parsed correctly.

Change-Id: I9fb79cfabd9b881c43150072e714c1559160e03d
Junkai Cai 4 rokov pred
rodič
commit
2f7a802e67
1 zmenil súbory, kde vykonal 8 pridanie a 1 odobranie
  1. 8 1
      asoc/codecs/swr-dmic.c

+ 8 - 1
asoc/codecs/swr-dmic.c

@@ -625,7 +625,14 @@ static int swr_dmic_probe(struct swr_device *pdev)
 		pdev->dev.of_node->full_name);
 		goto dev_err;
 	}
-	swr_dmic_parse_port_params(&pdev->dev, "qcom,swr-tx-port-params");
+
+	ret = swr_dmic_parse_port_params(&pdev->dev, "qcom,swr-tx-port-params");
+	if (ret) {
+		dev_err(&pdev->dev, "%s: Parsing %s failed in node %s\n",
+			__func__, "qcom,swr-tx-port-params",
+			pdev->dev.of_node->full_name);
+		goto dev_err;
+	}
 
 	/*
 	 * Add 5msec delay to provide sufficient time for